From d7a9f253a575bbc70943ddb181335e8529aa2dd5 Mon Sep 17 00:00:00 2001 From: Alfonso Subiotto Marques Date: Fri, 23 Jan 2026 09:46:14 +0100 Subject: [PATCH 1/2] fix[vortex-array]: fix filter of sliced list Previously when filtering a list array, we could create a mask longer than the sliced elements range, causing a "Filter mask length mismatch" panic. Signed-off-by: Alfonso Subiotto Marques --- vortex-array/src/arrays/list/tests.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/vortex-array/src/arrays/list/tests.rs b/vortex-array/src/arrays/list/tests.rs index 8b1f396ca62..e7ed7fed901 100644 --- a/vortex-array/src/arrays/list/tests.rs +++ b/vortex-array/src/arrays/list/tests.rs @@ -9,11 +9,16 @@ use vortex_dtype::DType; use vortex_dtype::Nullability; use vortex_dtype::PType::I32; use vortex_error::VortexExpect; +use vortex_error::VortexResult; use vortex_mask::Mask; use vortex_scalar::Scalar; use super::*; +use crate::Canonical; use crate::IntoArray; +use crate::LEGACY_SESSION; +use crate::VortexSessionExecute; +use crate::arrays::FilterArray; use crate::arrays::ListVTable; use crate::arrays::PrimitiveArray; use crate::assert_arrays_eq; @@ -905,3 +910,22 @@ fn test_recursive_compact_list_of_lists() { recursive.scalar_at(0).unwrap() ); } + +#[test] +fn test_filter_sliced_list_array() -> VortexResult<()> { + let list = ListArray::try_new( + buffer![0..50].into_array(), + buffer![0, 10, 20, 30, 40, 50].into_array(), + Validity::AllValid, + )? + .into_array() + .slice(2..5); + + let mask = Mask::from(BitBuffer::from(vec![true, false, true])); + let filter_array = FilterArray::new(list, mask).into_array(); + let mut ctx = LEGACY_SESSION.create_execution_ctx(); + let result = filter_array.execute::(&mut ctx)?; + + assert_eq!(result.len(), 2); + Ok(()) +} From f626cc1be68bd23a65d89527f89eab9cf536ed85 Mon Sep 17 00:00:00 2001 From: Andrew Duffy Date: Fri, 23 Jan 2026 16:08:03 -0500 Subject: [PATCH 2/2] rebase Signed-off-by: Andrew Duffy --- vortex-array/src/arrays/list/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vortex-array/src/arrays/list/tests.rs b/vortex-array/src/arrays/list/tests.rs index e7ed7fed901..4ba3e1f2b27 100644 --- a/vortex-array/src/arrays/list/tests.rs +++ b/vortex-array/src/arrays/list/tests.rs @@ -919,7 +919,7 @@ fn test_filter_sliced_list_array() -> VortexResult<()> { Validity::AllValid, )? .into_array() - .slice(2..5); + .slice(2..5)?; let mask = Mask::from(BitBuffer::from(vec![true, false, true])); let filter_array = FilterArray::new(list, mask).into_array();