Skip to content

fix(arrow/array): fix concat for out of order REE slices#587

Merged
zeroshade merged 2 commits into
apache:mainfrom
zeroshade:fix-ree-concat
Dec 2, 2025
Merged

fix(arrow/array): fix concat for out of order REE slices#587
zeroshade merged 2 commits into
apache:mainfrom
zeroshade:fix-ree-concat

Conversation

@zeroshade
Copy link
Copy Markdown
Member

Rationale for this change

fixes #562

What changes are included in this PR?

Fixing a bug in Concatenate for REE slices where the first slice has a non-zero offset

Are these changes tested?

Yes, a unit test is added for this scenario

Are there any user-facing changes?

Only the bug fix

@zeroshade zeroshade requested review from amoeba, kou and lidavidm December 1, 2025 17:14
@zeroshade
Copy link
Copy Markdown
Member Author

CC @Mandukhai-Alimaa

Comment thread arrow/array/encoded.go
buf.WriteByte('[')
for i := 0; i < r.ends.Len(); i++ {
if i != 0 {
for i := physOffset; i < physOffset+physLength; i++ {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: any reason we can't use the new i := range physOffset+physLength?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're not starting at 0, we're starting at physOffset.

We could do i := range physLength and then do offset := i + physOffset inside the loop, but I felt that wasn't as obvious and easily missed as opposed to explicitly going from physOffset to physOffset + physLength

@zeroshade zeroshade merged commit 7e53c0a into apache:main Dec 2, 2025
35 of 38 checks passed
@zeroshade zeroshade deleted the fix-ree-concat branch March 27, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Concat sliced REE out of order produces incorrect result

2 participants