You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RunArray::try_new rejects run ends whose null buffer has no nulls #12427
RunArray::try_new returns "Found null values in run_ends array" when run_ends has a null buffer with a null count of 0. It checks whether a null buffer is present, not whether any value is null. A PrimitiveArray can carry such a buffer: PrimitiveArray::new with NullBuffer::new_valid, slice of an array whose nulls fall outside the slice, and concat of a single array all produce one.
use arrow_array::types::Int32Type;use arrow_array::{Array,Int32Array,RunArray};use arrow_buffer::NullBuffer;fnmain(){let run_ends = Int32Array::new(vec![2,3].into(),Some(NullBuffer::new_valid(2)));let values = Int32Array::from(vec![7,8]);println!("{}", run_ends.null_count());// 0println!("{:?}",RunArray::<Int32Type>::try_new(&run_ends,&values).map(|a| a.len()));// Err(InvalidArgumentError("Found null values in run_ends array. The run_ends array should not have null values."))}
Expected behavior
Ok(3). Checking run_ends.null_count() != 0 instead of run_ends.nulls().is_some() would accept it and still reject run ends that hold a null.
Additional context
#12420 makes cast to the same type, shift by 0, and nullif of an empty array return the input's null buffer instead of dropping one with no nulls, so their output reaches this check more often.
Found while checking #12420 with property-based tests, on main at 6a3f719f.
Activity
Surajsuthar commentedon Nov 27, 2026
take
fix(arrow-array): Fix RunArray validation for zero-null validity buff…