Skip to content

concat_run_arrays errors with empty run ends #10781

Closed

Description

@thorfour

Describe the bug

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

Expected behavior

And empty array is returned from the function.

Additional context

No response

Activity

  1. added
    bug
    on Aug 21, 2026
  2. added theissue type on Aug 21, 2026
  3. Lstarsky0 commented on Aug 23, 2026

    @Lstarsky0
    Contributor

    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.

  4. added a commit that references this issue on Aug 24, 2026
    3577093
  5. added 2 commits that reference this issue on Aug 28, 2026
    c7fe148
    bcceabd
  6. added 3 commits that reference this issue on Sep 18, 2026
    55f1fcc
    372321d
    08bef3a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions