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
8 changes: 8 additions & 0 deletions encodings/alp/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ pub fn vortex_alp::ALPArray::ptype(&self) -> vortex_array::dtype::ptype::PType

pub fn vortex_alp::ALPArray::try_new(encoded: vortex_array::array::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option<vortex_array::patches::Patches>) -> vortex_error::VortexResult<Self>

impl vortex_alp::ALPArray

pub fn vortex_alp::ALPArray::to_array(&self) -> vortex_array::array::ArrayRef

impl core::clone::Clone for vortex_alp::ALPArray

pub fn vortex_alp::ALPArray::clone(&self) -> vortex_alp::ALPArray
Expand Down Expand Up @@ -86,6 +90,10 @@ pub fn vortex_alp::ALPRDArray::right_parts(&self) -> &vortex_array::array::Array

pub fn vortex_alp::ALPRDArray::try_new(dtype: vortex_array::dtype::DType, left_parts: vortex_array::array::ArrayRef, left_parts_dictionary: vortex_buffer::buffer::Buffer<u16>, right_parts: vortex_array::array::ArrayRef, right_bit_width: u8, left_parts_patches: core::option::Option<vortex_array::patches::Patches>) -> vortex_error::VortexResult<Self>

impl vortex_alp::ALPRDArray

pub fn vortex_alp::ALPRDArray::to_array(&self) -> vortex_array::array::ArrayRef

impl core::clone::Clone for vortex_alp::ALPRDArray

pub fn vortex_alp::ALPRDArray::clone(&self) -> vortex_alp::ALPRDArray
Expand Down
30 changes: 25 additions & 5 deletions encodings/alp/src/alp/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,11 @@ mod tests {

let result_canonical = {
let mut ctx = SESSION.create_execution_ctx();
encoded.to_array().execute::<Canonical>(&mut ctx).unwrap()
encoded
.clone()
.into_array()
.execute::<Canonical>(&mut ctx)
.unwrap()
};
// Compare against the traditional array-based decompress path
let expected =
Expand All @@ -551,7 +555,11 @@ mod tests {

let result_canonical = {
let mut ctx = SESSION.create_execution_ctx();
encoded.to_array().execute::<Canonical>(&mut ctx).unwrap()
encoded
.clone()
.into_array()
.execute::<Canonical>(&mut ctx)
.unwrap()
};
// Compare against the traditional array-based decompress path
let expected =
Expand Down Expand Up @@ -582,7 +590,11 @@ mod tests {

let result_canonical = {
let mut ctx = SESSION.create_execution_ctx();
encoded.to_array().execute::<Canonical>(&mut ctx).unwrap()
encoded
.clone()
.into_array()
.execute::<Canonical>(&mut ctx)
.unwrap()
};
// Compare against the traditional array-based decompress path
let expected =
Expand Down Expand Up @@ -611,7 +623,11 @@ mod tests {

let result_canonical = {
let mut ctx = SESSION.create_execution_ctx();
encoded.to_array().execute::<Canonical>(&mut ctx).unwrap()
encoded
.clone()
.into_array()
.execute::<Canonical>(&mut ctx)
.unwrap()
};
// Compare against the traditional array-based decompress path
let expected =
Expand Down Expand Up @@ -643,7 +659,11 @@ mod tests {

let result_canonical = {
let mut ctx = SESSION.create_execution_ctx();
encoded.to_array().execute::<Canonical>(&mut ctx).unwrap()
encoded
.clone()
.into_array()
.execute::<Canonical>(&mut ctx)
.unwrap()
};
// Compare against the traditional array-based decompress path
let expected =
Expand Down
8 changes: 4 additions & 4 deletions encodings/alp/src/alp/compute/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ mod tests {
);

let nullable_dtype = DType::Primitive(PType::F32, Nullability::Nullable);
let casted = alp.to_array().cast(nullable_dtype.clone())?;
let casted = alp.into_array().cast(nullable_dtype.clone())?;

let expected = values.cast(nullable_dtype)?;

Expand All @@ -104,7 +104,7 @@ mod tests {
let alp = alp_encode(&values.to_primitive(), None)?;

let casted = alp
.to_array()
.into_array()
.cast(DType::Primitive(PType::F64, Nullability::NonNullable))?;
assert_eq!(
casted.dtype(),
Expand All @@ -126,7 +126,7 @@ mod tests {
let alp = alp_encode(&values.to_primitive(), None)?;

let casted = alp
.to_array()
.into_array()
.cast(DType::Primitive(PType::I32, Nullability::NonNullable))?;
assert_eq!(
casted.dtype(),
Expand All @@ -147,7 +147,7 @@ mod tests {
#[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<()> {
let alp = alp_encode(&array.to_primitive(), None).vortex_expect("cannot fail");
test_cast_conformance(&alp.to_array());
test_cast_conformance(&alp.into_array());

Ok(())
}
Expand Down
5 changes: 3 additions & 2 deletions encodings/alp/src/alp/compute/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use vortex_array::ArrayRef;
use vortex_array::ExecutionCtx;
use vortex_array::IntoArray;
use vortex_array::arrays::FilterKernel;
use vortex_error::VortexResult;
use vortex_mask::Mask;
Expand Down Expand Up @@ -31,7 +32,7 @@ impl FilterKernel for ALPVTable {
patches,
array.dtype().clone(),
)
.to_array(),
.into_array(),
))
}
}
Expand Down Expand Up @@ -60,6 +61,6 @@ mod test {
].into_array())]
fn test_filter_alp_conformance(#[case] array: ArrayRef) {
let alp = alp_encode(&array.to_primitive(), None).unwrap();
test_filter_conformance(&alp.to_array());
test_filter_conformance(&alp.into_array());
}
}
9 changes: 5 additions & 4 deletions encodings/alp/src/alp/compute/mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use vortex_array::ArrayRef;
use vortex_array::ExecutionCtx;
use vortex_array::IntoArray;
use vortex_array::builtins::ArrayBuiltins;
use vortex_array::scalar_fn::fns::mask::MaskKernel;
use vortex_array::scalar_fn::fns::mask::MaskReduce;
Expand All @@ -20,7 +21,7 @@ impl MaskReduce for ALPVTable {
}
let masked_encoded = array.encoded().clone().mask(mask.clone())?;
Ok(Some(
ALPArray::new(masked_encoded, array.exponents(), None).to_array(),
ALPArray::new(masked_encoded, array.exponents(), None).into_array(),
))
}
}
Expand All @@ -39,7 +40,7 @@ impl MaskKernel for ALPVTable {
.transpose()?
.flatten();
Ok(Some(
ALPArray::new(masked_encoded, array.exponents(), masked_patches).to_array(),
ALPArray::new(masked_encoded, array.exponents(), masked_patches).into_array(),
))
}
}
Expand All @@ -66,7 +67,7 @@ mod test {
].into_array())]
fn test_mask_alp_conformance(#[case] array: vortex_array::ArrayRef) {
let alp = alp_encode(&array.to_primitive(), None).unwrap();
test_mask_conformance(&alp.to_array());
test_mask_conformance(&alp.into_array());
}

#[test]
Expand All @@ -79,6 +80,6 @@ mod test {
let array = PrimitiveArray::from_iter(values);
let alp = alp_encode(&array, None).unwrap();
assert!(alp.patches().is_some(), "expected patches");
test_mask_conformance(&alp.to_array());
test_mask_conformance(&alp.into_array());
}
}
2 changes: 1 addition & 1 deletion encodings/alp/src/alp/compute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ mod tests {
#[case::repeating_pattern(alp_encode(&PrimitiveArray::from_iter([1.1f32, 2.2, 3.3, 1.1, 2.2, 3.3, 1.1, 2.2, 3.3]), None).unwrap())]
#[case::close_values(alp_encode(&PrimitiveArray::from_iter([100.001f64, 100.002, 100.003, 100.004, 100.005]), None).unwrap())]
fn test_alp_consistency(#[case] array: ALPArray) {
test_array_consistency(&array.to_array());
test_array_consistency(&array.into_array());
}

#[rstest]
Expand Down
2 changes: 1 addition & 1 deletion encodings/alp/src/alp/compute/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ mod test {
#[case(buffer![42.42f64].into_array())]
fn test_take_alp_conformance(#[case] array: vortex_array::ArrayRef) {
let alp = alp_encode(&array.to_primitive(), None).unwrap();
test_take_conformance(&alp.to_array());
test_take_conformance(&alp.into_array());
}
}
10 changes: 6 additions & 4 deletions encodings/alp/src/alp_rd/compute/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ impl CastReduce for ALPRDVTable {
#[cfg(test)]
mod tests {
use rstest::rstest;
use vortex_array::IntoArray;
use vortex_array::ToCanonical;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::builtins::ArrayBuiltins;
Expand All @@ -66,7 +67,7 @@ mod tests {
let alprd = encoder.encode(&arr);

let casted = alprd
.to_array()
.into_array()
.cast(DType::Primitive(PType::F64, Nullability::NonNullable))
.unwrap();
assert_eq!(
Expand All @@ -91,13 +92,14 @@ mod tests {

// Cast to NonNullable should fail since we have nulls
let result = alprd
.to_array()
.clone()
.into_array()
.cast(DType::Primitive(PType::F64, Nullability::NonNullable));
assert!(result.is_err());

// Cast to same type with Nullable should succeed
let casted = alprd
.to_array()
.into_array()
.cast(DType::Primitive(PType::F64, Nullability::Nullable))
.unwrap();
assert_eq!(
Expand Down Expand Up @@ -138,6 +140,6 @@ mod tests {
encoder.encode(&arr)
})]
fn test_cast_alprd_conformance(#[case] alprd: crate::alp_rd::ALPRDArray) {
test_cast_conformance(&alprd.to_array());
test_cast_conformance(&alprd.into_array());
}
}
2 changes: 1 addition & 1 deletion encodings/alp/src/alp_rd/compute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ mod tests {
encoder.encode(&arr)
})]
fn test_alp_rd_consistency(#[case] array: ALPRDArray) {
test_array_consistency(&array.to_array());
test_array_consistency(&array.into_array());
}

#[rstest]
Expand Down
7 changes: 4 additions & 3 deletions encodings/alp/src/alp_rd/compute/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl TakeExecute for ALPRDVTable {
#[cfg(test)]
mod test {
use rstest::rstest;
use vortex_array::IntoArray;
use vortex_array::ToCanonical;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::assert_arrays_eq;
Expand Down Expand Up @@ -109,7 +110,7 @@ mod test {
);

let taken = encoded
.take(PrimitiveArray::from_option_iter([Some(0), Some(2), None]).to_array())
.take(PrimitiveArray::from_option_iter([Some(0), Some(2), None]).into_array())
.unwrap()
.to_primitive();

Expand All @@ -126,7 +127,7 @@ mod test {
test_take_conformance(
&RDEncoder::new(&[a, b])
.encode(&PrimitiveArray::from_iter([a, b, outlier, b, outlier]))
.to_array(),
.into_array(),
);
}

Expand All @@ -143,7 +144,7 @@ mod test {
Some(a),
None,
]))
.to_array(),
.into_array(),
);
}
}
4 changes: 4 additions & 0 deletions encodings/bytebool/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ pub fn vortex_bytebool::ByteBoolArray::from_vec<V: core::convert::Into<vortex_ar

pub fn vortex_bytebool::ByteBoolArray::new(buffer: vortex_array::buffer::BufferHandle, validity: vortex_array::validity::Validity) -> Self

impl vortex_bytebool::ByteBoolArray

pub fn vortex_bytebool::ByteBoolArray::to_array(&self) -> vortex_array::array::ArrayRef

impl core::clone::Clone for vortex_bytebool::ByteBoolArray

pub fn vortex_bytebool::ByteBoolArray::clone(&self) -> vortex_bytebool::ByteBoolArray
Expand Down
Loading
Loading