Skip to content

fix: account for offset when building RunArray from ArrayData - #11660

Merged
alamb merged 2 commits into
apache:mainfrom
Jefffrey:run-array-from-offset
Oct 19, 2026
Merged

alamb merged 2 commits into
apache:mainfrom
Jefffrey:run-array-from-offset

Conversation

@Jefffrey

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

None

Rationale for this change

Correctness issue when building run arrays from array data

What changes are included in this PR?

Apply arraydata offset to run ends child array when constructing runarray from data

Are these changes tested?

yes

Are there any significant user-facing changes?

no

@Jefffrey Jefffrey added the bug Squash those bugs label Oct 18, 2026
@github-actions github-actions Bot added the arrow-core Core crates related to representing arrow data label Oct 18, 2026
@Jefffrey
Jefffrey marked this pull request as draft October 18, 2026 03:04

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @Jefffrey

let runs = ArrayData::builder(DataType::Int32)
.len(2)
.offset(2)
.add_buffer(vec![-10_i32, -20, 1_i32, 4, 0, 100].into())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

so this sets the runs to [1,4] I think, so the actual array is
1.5, 2.5, 2.5, 2.5, 2.5

@alamb
alamb added this pull request to the merge queue Oct 19, 2026
Merged via the queue into apache:main with commit ee9f2a3 Oct 19, 2026
35 checks passed
alamb added a commit that referenced this pull request Oct 20, 2026
…ArrayData (#11739)

- Backport #11660
- For inclusion in #11664

Cherry-pick of
ee9f2a3

Note: the test uses literal `"run_ends"` / `"values"` field names
because `Field::REE_*_FIELD_DEFAULT_NAME` constants are not on the 59
line.

Co-authored-by: Jeffrey Vo <[email protected]>
@Jefffrey
Jefffrey deleted the run-array-from-offset branch October 21, 2026 10:36
alamb pushed a commit that referenced this pull request Oct 21, 2026
…ArrayData (#11766)

- Backport #11660
- For inclusion in #11665

Cherry-pick of
ee9f2a3
alamb pushed a commit that referenced this pull request Oct 22, 2026
…ArrayData (#11800)

- Backport #11660
- For inclusion in #11666

Cherry-pick of
ee9f2a3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow-core Core crates related to representing arrow data bug Squash those bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants