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
concat_run_arrays errors with empty run ends #10781
If arrays with empty run_ends are passed into concat_run_arrays instead of returning an empty array it passes the empty arrays into the concat function which throws an error because it doesn't support empty arrays.
To Reproduce
Pass arrays with empty run_ends into concat_run_arrays
Reproduced, and it is narrower than the title suggests — it needs two or more arrays that are all empty:
let empty = || RunArray::try_new(&Int32Array::from(Vec::<i32>::new()),&Int32Array::from(Vec::<i32>::new()),).unwrap();concat(&[&empty()])// Ok(0)
concat(&[&empty(),&empty()])// Err
concat(&[&empty(),&nonempty()])// Ok(4)
PROBE one empty: Ok(0)
PROBE two empties: Err(ComputeError("concat requires input of at least one array"))
PROBE empty+nonempty: Ok(4)
A single array never reaches concat_run_arrays — concat short-circuits at arrays.len() == 1 and returns a slice. One empty alongside a non-empty is fine because the filter at concat.rs:424 drops it and one survives.
The mechanism is the other way round from the description: the empty arrays are not passed into concat, they are filtered out by that same line, and it is the resulting empty slice that concat rejects at concat.rs:458.
That distinction matters for the fix. concat cannot accept the empty slice — it has no data type to build a result from. The early return has to be in concat_run_arrays, and its data type has to come from arrays[0] rather than run_arrays[0], which is empty in exactly this case.
There is also a second landmine two lines later: run_arrays[0].data_type() at concat.rs:460 panics on the same input. Today ? on line 458 returns first, so a fix that only makes line 458 tolerate an empty slice would turn the error into a panic.
concat_dictionaries does not have this shape — it has no filter, so it never ends up with fewer arrays than it started with.
Activity
Lstarsky0 commentedon Aug 23, 2026
Reproduced, and it is narrower than the title suggests — it needs two or more arrays that are all empty:
A single array never reaches
concat_run_arrays—concatshort-circuits atarrays.len() == 1and returns a slice. One empty alongside a non-empty is fine because the filter atconcat.rs:424drops it and one survives.The mechanism is the other way round from the description: the empty arrays are not passed into
concat, they are filtered out by that same line, and it is the resulting empty slice thatconcatrejects atconcat.rs:458.That distinction matters for the fix.
concatcannot accept the empty slice — it has no data type to build a result from. The early return has to be inconcat_run_arrays, and its data type has to come fromarrays[0]rather thanrun_arrays[0], which is empty in exactly this case.There is also a second landmine two lines later:
run_arrays[0].data_type()atconcat.rs:460panics on the same input. Today?on line 458 returns first, so a fix that only makes line 458 tolerate an empty slice would turn the error into a panic.concat_dictionariesdoes not have this shape — it has no filter, so it never ends up with fewer arrays than it started with.fix(arrow-select): handle all-empty run arrays in concat_run_arrays (a…
[59_maintenance] Backport fix for concat_run_arrays with all-empty ru…
fix(arrow-select): handle all-empty run arrays in concat_run_arrays (a…
fix(arrow-select): handle all-empty run arrays in concat_run_arrays (a…
fix(arrow-select): handle all-empty run arrays in concat_run_arrays (a…
fix(arrow-select): handle all-empty run arrays in concat_run_arrays (a…
fix(arrow-select): handle all-empty run arrays in concat_run_arrays (a…