Skip to content

[59_maintenance] Backport fix for concat_run_arrays with all-empty run arrays - #10828

Open
alamb wants to merge 1 commit into
apache:59_maintenancefrom
alamb:backport-10782-59
Open

[59_maintenance] Backport fix for concat_run_arrays with all-empty run arrays#10828
alamb wants to merge 1 commit into
apache:59_maintenancefrom
alamb:backport-10782-59

Conversation

@alamb

@alamb alamb commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Backport the fix for concat_run_arrays erroring when every input RunArray has empty run_ends (#10781) to the 59_maintenance branch so it is included in the 59.3.0 release.

What changes are included in this PR?

Backport / Cherry-pick:

Are these changes tested?

By CI

Are there any user-facing changes?

No

…pache#10782)

concat_run_arrays filters out any input RunArray whose run_ends() is
empty before concatenating their values. When every input is filtered
out this way (e.g. concatenating two zero-length slices of a nested
RunEndEncoded struct field), the resulting values_slices is empty and
falls through to concat(&[]), which errors because a type-erased &[&dyn
Array] with no elements carries no DataType to build a result from.

Add an early return for the empty-after-filter case, building a valid
zero-length array from the original (non-empty) input's DataType
instead.

# Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax.
-->

- Closes apache#10781.

# Rationale for this change

`concat_run_arrays` should return a valid array instead of an error when
empty run_ends are passed into it.

# What changes are included in this PR?

A small empty run arrays check that returns an empty array of the data
type instead.

# Are these changes tested?

Yes a unit test was added

# Are there any user-facing changes?

No

---------

Co-authored-by: Jeffrey Vo <jeffrey.vo.australia@gmail.com>
(cherry picked from commit 3577093)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate arrow-select

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants