diff --git a/vortex-array/src/arrow/executor/fixed_size_list.rs b/vortex-array/src/arrow/executor/fixed_size_list.rs index 6da7c40aa58..9031ebadb03 100644 --- a/vortex-array/src/arrow/executor/fixed_size_list.rs +++ b/vortex-array/src/arrow/executor/fixed_size_list.rs @@ -55,10 +55,13 @@ fn list_to_list( let null_buffer = to_arrow_null_buffer(array.validity().clone(), array.len(), ctx)?; - Ok(Arc::new(arrow_array::FixedSizeListArray::new( - elements_field.clone(), - list_size, - elements, - null_buffer, - ))) + Ok(Arc::new( + arrow_array::FixedSizeListArray::try_new_with_length( + elements_field.clone(), + list_size, + elements, + null_buffer, + array.len(), + )?, + )) } diff --git a/vortex-array/src/dtype/arbitrary/mod.rs b/vortex-array/src/dtype/arbitrary/mod.rs index 3711b904472..a0afbbb3c26 100644 --- a/vortex-array/src/dtype/arbitrary/mod.rs +++ b/vortex-array/src/dtype/arbitrary/mod.rs @@ -6,6 +6,7 @@ use std::sync::Arc; use arbitrary::Arbitrary; use arbitrary::Result; use arbitrary::Unstructured; +use vortex_error::VortexExpect; use crate::dtype::DType; use crate::dtype::DecimalDType; @@ -34,8 +35,7 @@ impl<'a> Arbitrary<'a> for FieldName { fn random_dtype(u: &mut Unstructured<'_>, depth: u8) -> Result { const BASE_TYPE_COUNT: i32 = 5; - // TODO(joe): update to 3 once fsl works - const CONTAINER_TYPE_COUNT: i32 = 2; + const CONTAINER_TYPE_COUNT: i32 = 3; let max_dtype_kind = if depth == 0 { BASE_TYPE_COUNT } else { @@ -52,12 +52,12 @@ fn random_dtype(u: &mut Unstructured<'_>, depth: u8) -> Result { // container types 6 => DType::Struct(random_struct_dtype(u, depth - 1)?, u.arbitrary()?), 7 => DType::List(Arc::new(random_dtype(u, depth - 1)?), u.arbitrary()?), - // 8 => DType::FixedSizeList( - // Arc::new(random_dtype(u, depth - 1)?), - // // We limit the list size to 3 rather (following random struct fields). - // u.choose_index(3)?.try_into().vortex_expect("impossible"), - // u.arbitrary()?, - // ), + 8 => DType::FixedSizeList( + Arc::new(random_dtype(u, depth - 1)?), + // We limit the list size to 3 rather (following random struct fields). + u.choose_index(3)?.try_into().vortex_expect("impossible"), + u.arbitrary()?, + ), // Null, // Extension(ExtDType, Nullability), _ => unreachable!("Number out of range"),