Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions df-q6-parquet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"all_runtimes":[140238709],"commit_id":"5b3726ee1725a1c21e3ab935d21ef48435e97197","dataset":{"tpch":{"scale_factor":"10.0"}},"env_triple":{"architecture":"aarch64","environment":"unknown","operating_system":"darwin"},"name":"tpch_q06/datafusion:parquet","storage":"nvme","target":{"engine":"datafusion","format":"parquet"},"unit":"ns","value":140238709}
2 changes: 2 additions & 0 deletions encodings/alp/src/alp/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ mod tests {
use vortex_array::Canonical;
use vortex_array::IntoArray;
use vortex_array::LEGACY_SESSION;
#[expect(deprecated)]
use vortex_array::ToCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
Expand Down Expand Up @@ -808,6 +809,7 @@ mod tests {
let slice_len = slice_end - slice_start;
let sliced_encoded = encoded.slice(slice_start..slice_end).unwrap();

#[expect(deprecated)]
let result_primitive = sliced_encoded.to_primitive();

for idx in 0..slice_len {
Expand Down
16 changes: 16 additions & 0 deletions encodings/alp/src/alp/compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ mod tests {
use f64::consts::E;
use f64::consts::PI;
use vortex_array::LEGACY_SESSION;
#[expect(deprecated)]
use vortex_array::ToCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::assert_arrays_eq;
Expand Down Expand Up @@ -280,6 +281,7 @@ mod tests {
&mut LEGACY_SESSION.create_execution_ctx(),
)
.unwrap();
#[expect(deprecated)]
let decompressed = alp_arr.into_array().to_primitive();

assert_eq!(
Expand All @@ -303,6 +305,7 @@ mod tests {
&mut LEGACY_SESSION.create_execution_ctx(),
)
.unwrap();
#[expect(deprecated)]
let decoded = encoded.as_array().to_primitive();
for idx in 0..original.len() {
let decoded_val = decoded.as_slice::<f32>()[idx];
Expand Down Expand Up @@ -331,14 +334,17 @@ mod tests {
.unwrap();
let patches = encoded.patches().unwrap();

#[expect(deprecated)]
let chunk_offsets = patches.chunk_offsets().clone().unwrap().to_primitive();
let expected_offsets = PrimitiveArray::from_iter(vec![0u64, 1, 3]);
assert_arrays_eq!(chunk_offsets, expected_offsets);

#[expect(deprecated)]
let patch_indices = patches.indices().to_primitive();
let expected_indices = PrimitiveArray::from_iter(vec![1023u64, 1024, 1025]);
assert_arrays_eq!(patch_indices, expected_indices);

#[expect(deprecated)]
let patch_values = patches.values().to_primitive();
let expected_values = PrimitiveArray::from_iter(vec![PI, E, PI]);
assert_arrays_eq!(patch_values, expected_values);
Expand All @@ -359,14 +365,17 @@ mod tests {
.unwrap();
let patches = encoded.patches().unwrap();

#[expect(deprecated)]
let chunk_offsets = patches.chunk_offsets().clone().unwrap().to_primitive();
let expected_offsets = PrimitiveArray::from_iter(vec![0u64, 1, 1]);
assert_arrays_eq!(chunk_offsets, expected_offsets);

#[expect(deprecated)]
let patch_indices = patches.indices().to_primitive();
let expected_indices = PrimitiveArray::from_iter(vec![0u64, 2048]);
assert_arrays_eq!(patch_indices, expected_indices);

#[expect(deprecated)]
let patch_values = patches.values().to_primitive();
let expected_values = PrimitiveArray::from_iter(vec![PI, E]);
assert_arrays_eq!(patch_values, expected_values);
Expand All @@ -386,14 +395,17 @@ mod tests {
.unwrap();
let patches = encoded.patches().unwrap();

#[expect(deprecated)]
let chunk_offsets = patches.chunk_offsets().clone().unwrap().to_primitive();
let expected_offsets = PrimitiveArray::from_iter(vec![0u64, 1, 1]);
assert_arrays_eq!(chunk_offsets, expected_offsets);

#[expect(deprecated)]
let patch_indices = patches.indices().to_primitive();
let expected_indices = PrimitiveArray::from_iter(vec![0u64]);
assert_arrays_eq!(patch_indices, expected_indices);

#[expect(deprecated)]
let patch_values = patches.values().to_primitive();
let expected_values = PrimitiveArray::from_iter(vec![PI]);
assert_arrays_eq!(patch_values, expected_values);
Expand All @@ -414,14 +426,17 @@ mod tests {
.unwrap();
let patches = encoded.patches().unwrap();

#[expect(deprecated)]
let chunk_offsets = patches.chunk_offsets().clone().unwrap().to_primitive();
let expected_offsets = PrimitiveArray::from_iter(vec![0u64]);
assert_arrays_eq!(chunk_offsets, expected_offsets);

#[expect(deprecated)]
let patch_indices = patches.indices().to_primitive();
let expected_indices = PrimitiveArray::from_iter(vec![0u64, 100]);
assert_arrays_eq!(patch_indices, expected_indices);

#[expect(deprecated)]
let patch_values = patches.values().to_primitive();
let expected_values = PrimitiveArray::from_iter(vec![PI, E]);
assert_arrays_eq!(patch_values, expected_values);
Expand Down Expand Up @@ -524,6 +539,7 @@ mod tests {
.unwrap();

let sliced_alp = encoded.slice(512..1024).unwrap();
#[expect(deprecated)]
let decoded = sliced_alp.to_primitive();

let expected_slice = original.slice(512..1024).unwrap();
Expand Down
23 changes: 18 additions & 5 deletions encodings/alp/src/alp/compute/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ mod tests {
use rstest::rstest;
use vortex_array::IntoArray;
use vortex_array::LEGACY_SESSION;
#[expect(deprecated)]
use vortex_array::ToCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
Expand All @@ -80,8 +81,10 @@ mod tests {
#[test]
fn issue_5766_test_cast_alp_with_patches_to_nullable() -> VortexResult<()> {
let values = buffer![1.234f32, f32::NAN, 2.345, f32::INFINITY, 3.456].into_array();
#[expect(deprecated)]
let values_primitive = values.to_primitive();
let alp = alp_encode(
values.to_primitive().as_view(),
values_primitive.as_view(),
None,
&mut LEGACY_SESSION.create_execution_ctx(),
)?;
Expand All @@ -96,16 +99,20 @@ mod tests {

let expected = values.cast(nullable_dtype)?;

assert_arrays_eq!(casted.to_canonical()?.into_primitive(), expected);
#[expect(deprecated)]
let casted_prim = casted.to_canonical()?.into_primitive();
assert_arrays_eq!(casted_prim, expected);

Ok(())
}

#[test]
fn test_cast_alp_f32_to_f64() -> VortexResult<()> {
let values = buffer![1.5f32, 2.5, 3.5, 4.5].into_array();
#[expect(deprecated)]
let values_primitive = values.to_primitive();
let alp = alp_encode(
values.to_primitive().as_view(),
values_primitive.as_view(),
None,
&mut LEGACY_SESSION.create_execution_ctx(),
)?;
Expand All @@ -118,6 +125,7 @@ mod tests {
&DType::Primitive(PType::F64, Nullability::NonNullable)
);

#[expect(deprecated)]
let decoded = casted.to_canonical()?.into_primitive();
let values = decoded.as_slice::<f64>();
assert_eq!(values.len(), 4);
Expand All @@ -130,8 +138,10 @@ mod tests {
#[test]
fn test_cast_alp_to_int() -> VortexResult<()> {
let values = buffer![1.0f32, 2.0, 3.0, 4.0].into_array();
#[expect(deprecated)]
let values_primitive = values.to_primitive();
let alp = alp_encode(
values.to_primitive().as_view(),
values_primitive.as_view(),
None,
&mut LEGACY_SESSION.create_execution_ctx(),
)?;
Expand All @@ -144,6 +154,7 @@ mod tests {
&DType::Primitive(PType::I32, Nullability::NonNullable)
);

#[expect(deprecated)]
let decoded = casted.to_canonical()?.into_primitive();
assert_arrays_eq!(decoded, PrimitiveArray::from_iter([1i32, 2, 3, 4]));

Expand All @@ -157,8 +168,10 @@ mod tests {
#[case(buffer![42.42f64].into_array())]
#[case(buffer![0.0f32, -1.5, 2.5, -3.5, 4.5].into_array())]
fn test_cast_alp_conformance(#[case] array: vortex_array::ArrayRef) -> VortexResult<()> {
#[expect(deprecated)]
let array_primitive = array.to_primitive();
let alp = alp_encode(
array.to_primitive().as_view(),
array_primitive.as_view(),
None,
&mut LEGACY_SESSION.create_execution_ctx(),
)
Expand Down
29 changes: 13 additions & 16 deletions encodings/alp/src/alp/compute/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ mod tests {
use rstest::rstest;
use vortex_array::ArrayRef;
use vortex_array::LEGACY_SESSION;
#[expect(deprecated)]
use vortex_array::ToCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::BoolArray;
Expand Down Expand Up @@ -192,10 +193,9 @@ mod tests {
)
.unwrap();
assert!(encoded.patches().is_none());
assert_eq!(
encoded.encoded().to_primitive().as_slice::<i32>(),
vec![1234; 1025]
);
#[expect(deprecated)]
let encoded_prim = encoded.encoded().to_primitive();
assert_eq!(encoded_prim.as_slice::<i32>(), vec![1234; 1025]);

let r = alp_scalar_compare(encoded.as_view(), 1.3_f32, CompareOperator::Eq)
.unwrap()
Expand All @@ -220,10 +220,9 @@ mod tests {
)
.unwrap();
assert!(encoded.patches().is_none());
assert_eq!(
encoded.encoded().to_primitive().as_slice::<i32>(),
vec![1234; 1025]
);
#[expect(deprecated)]
let encoded_prim = encoded.encoded().to_primitive();
assert_eq!(encoded_prim.as_slice::<i32>(), vec![1234; 1025]);

let r_eq = alp_scalar_compare(encoded.as_view(), 1.234444_f32, CompareOperator::Eq)
.unwrap()
Expand All @@ -248,10 +247,9 @@ mod tests {
)
.unwrap();
assert!(encoded.patches().is_none());
assert_eq!(
encoded.encoded().to_primitive().as_slice::<i32>(),
vec![605; 10]
);
#[expect(deprecated)]
let encoded_prim = encoded.encoded().to_primitive();
assert_eq!(encoded_prim.as_slice::<i32>(), vec![605; 10]);

// !(0.0605_f32 >= 0.06051_f32);
let r_gte = alp_scalar_compare(encoded.as_view(), 0.06051_f32, CompareOperator::Gte)
Expand Down Expand Up @@ -292,10 +290,9 @@ mod tests {
)
.unwrap();
assert!(encoded.patches().is_none());
assert_eq!(
encoded.encoded().to_primitive().as_slice::<i32>(),
vec![0; 10]
);
#[expect(deprecated)]
let encoded_prim = encoded.encoded().to_primitive();
assert_eq!(encoded_prim.as_slice::<i32>(), vec![0; 10]);

let r_gte =
test_alp_compare(encoded.as_view(), -0.00000001_f32, CompareOperator::Gte).unwrap();
Expand Down
5 changes: 4 additions & 1 deletion encodings/alp/src/alp/compute/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ mod test {
use vortex_array::ArrayRef;
use vortex_array::IntoArray;
use vortex_array::LEGACY_SESSION;
#[expect(deprecated)]
use vortex_array::ToCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
Expand All @@ -63,8 +64,10 @@ mod test {
11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0
].into_array())]
fn test_filter_alp_conformance(#[case] array: ArrayRef) {
#[expect(deprecated)]
let array_primitive = array.to_primitive();
let alp = alp_encode(
array.to_primitive().as_view(),
array_primitive.as_view(),
None,
&mut LEGACY_SESSION.create_execution_ctx(),
)
Expand Down
5 changes: 4 additions & 1 deletion encodings/alp/src/alp/compute/mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ mod test {
use rstest::rstest;
use vortex_array::IntoArray;
use vortex_array::LEGACY_SESSION;
#[expect(deprecated)]
use vortex_array::ToCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::BoolArray;
Expand All @@ -79,8 +80,10 @@ mod test {
1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0
].into_array())]
fn test_mask_alp_conformance(#[case] array: vortex_array::ArrayRef) {
#[expect(deprecated)]
let array_primitive = array.to_primitive();
let alp = alp_encode(
array.to_primitive().as_view(),
array_primitive.as_view(),
None,
&mut LEGACY_SESSION.create_execution_ctx(),
)
Expand Down
5 changes: 4 additions & 1 deletion encodings/alp/src/alp/compute/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ mod test {
use rstest::rstest;
use vortex_array::IntoArray;
use vortex_array::LEGACY_SESSION;
#[expect(deprecated)]
use vortex_array::ToCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
Expand All @@ -57,8 +58,10 @@ mod test {
#[case(PrimitiveArray::from_option_iter([Some(1.1f32), None, Some(2.2), Some(3.3), None]).into_array())]
#[case(buffer![42.42f64].into_array())]
fn test_take_alp_conformance(#[case] array: vortex_array::ArrayRef) {
#[expect(deprecated)]
let array_primitive = array.to_primitive();
let alp = alp_encode(
array.to_primitive().as_view(),
array_primitive.as_view(),
None,
&mut LEGACY_SESSION.create_execution_ctx(),
)
Expand Down
6 changes: 5 additions & 1 deletion encodings/alp/src/alp_rd/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,9 @@ impl ALPRDData {
let mut patches = patches.cast_values(&left_parts.dtype().as_nonnullable())?;
// Force execution of the lazy cast so patch values are materialized
// before serialization.
*patches.values_mut() = patches.values().to_canonical()?.into_array();
#[expect(deprecated)]
let canonical = patches.values().to_canonical()?.into_array();
*patches.values_mut() = canonical;
Ok(patches)
})
.transpose()
Expand Down Expand Up @@ -660,6 +662,7 @@ impl ValidityChild<ALPRD> for ALPRD {
mod test {
use prost::Message;
use rstest::rstest;
#[expect(deprecated)]
use vortex_array::ToCanonical;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::assert_arrays_eq;
Expand Down Expand Up @@ -693,6 +696,7 @@ mod test {

let rd_array = encoder.encode(real_array.as_view());

#[expect(deprecated)]
let decoded = rd_array.as_array().to_primitive();

assert_arrays_eq!(decoded, PrimitiveArray::from_option_iter(reals));
Expand Down
2 changes: 2 additions & 0 deletions encodings/alp/src/alp_rd/compute/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ impl CastReduce for ALPRD {
mod tests {
use rstest::rstest;
use vortex_array::IntoArray;
#[expect(deprecated)]
use vortex_array::ToCanonical;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::builtins::ArrayBuiltins;
Expand All @@ -76,6 +77,7 @@ mod tests {
&DType::Primitive(PType::F64, Nullability::NonNullable)
);

#[expect(deprecated)]
let decoded = casted.to_primitive();
let f64_values = decoded.as_slice::<f64>();
assert_eq!(f64_values.len(), 5);
Expand Down
3 changes: 3 additions & 0 deletions encodings/alp/src/alp_rd/compute/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ impl TakeExecute for ALPRD {
mod test {
use rstest::rstest;
use vortex_array::IntoArray;
#[expect(deprecated)]
use vortex_array::ToCanonical;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::assert_arrays_eq;
Expand Down Expand Up @@ -86,6 +87,7 @@ mod test {
.is_unsigned_int()
);

#[expect(deprecated)]
let taken = encoded
.take(buffer![0, 2].into_array())
.unwrap()
Expand All @@ -110,6 +112,7 @@ mod test {
.is_unsigned_int()
);

#[expect(deprecated)]
let taken = encoded
.take(PrimitiveArray::from_option_iter([Some(0), Some(2), None]).into_array())
.unwrap()
Expand Down
Loading
Loading