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
15 changes: 9 additions & 6 deletions vortex-array/src/arrow/executor/fixed_size_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)?,
))
}
16 changes: 8 additions & 8 deletions vortex-array/src/dtype/arbitrary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -34,8 +35,7 @@ impl<'a> Arbitrary<'a> for FieldName {

fn random_dtype(u: &mut Unstructured<'_>, depth: u8) -> Result<DType> {
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 {
Expand All @@ -52,12 +52,12 @@ fn random_dtype(u: &mut Unstructured<'_>, depth: u8) -> Result<DType> {
// 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"),
Expand Down
Loading