diff --git a/vortex-array/src/array/chunked/compute/compare.rs b/vortex-array/src/array/chunked/compute/compare.rs index 5aeaba6fd5..d6418b2093 100644 --- a/vortex-array/src/array/chunked/compute/compare.rs +++ b/vortex-array/src/array/chunked/compute/compare.rs @@ -37,19 +37,17 @@ impl CompareFn for ChunkedEncoding { mod tests { use super::*; - use crate::array::StructArray; - use crate::validity::Validity; + use crate::array::PrimitiveArray; #[test] fn empty_compare() { - let base = StructArray::try_new([].into(), [].into(), 0, Validity::NonNullable) - .unwrap() - .into_array(); + let base = PrimitiveArray::from_iter(Vec::::new()).into_array(); let chunked = ChunkedArray::try_new(vec![base.clone(), base.clone()], base.dtype().clone()).unwrap(); let chunked_empty = ChunkedArray::try_new(vec![], base.dtype().clone()).unwrap(); let r = compare(&chunked, &chunked_empty, Operator::Eq).unwrap(); + assert!(r.is_empty()); } } diff --git a/vortex-array/src/compute/compare.rs b/vortex-array/src/compute/compare.rs index 7a0aede5f8..aca89d40dc 100644 --- a/vortex-array/src/compute/compare.rs +++ b/vortex-array/src/compute/compare.rs @@ -112,6 +112,14 @@ pub fn compare( vortex_bail!("Compare operations only support arrays of the same type"); } + if left.dtype().is_struct() { + vortex_bail!( + "Compare does not support arrays with Strcut DType, got: {} and {}", + left.dtype(), + right.dtype() + ) + } + let result_dtype = DType::Bool((left.dtype().is_nullable() || right.dtype().is_nullable()).into());