Skip to content

fix(arrow-data): account for struct parent offsets - #10934

Merged
Jefffrey merged 2 commits into
apache:mainfrom
jaideeppyne:fix/struct-arraydata-parent-offset
Sep 2, 2026
Merged

fix(arrow-data): account for struct parent offsets#10934
Jefffrey merged 2 commits into
apache:mainfrom
jaideeppyne:fix/struct-arraydata-parent-offset

Conversation

@jaideeppyne

Copy link
Copy Markdown
Contributor

Closes #10933.

Struct ArrayData parent offsets compose with child offsets, but a few paths were still treating child data as if parent offset were always zero. This updates:

  • struct child validation to require offset + len child elements
  • struct equality to compare child values at parent_offset + logical_start
  • struct MutableArrayData extension to copy from the parent-offset-adjusted child range

The regression tests cover the concrete cases from #10933: validation, equality, and MutableArrayData::try_extend.

Validation run locally:

cargo test -p arrow-data --lib
cargo fmt --check
cargo clippy -p arrow-data --lib --tests -- -D warnings

@github-actions github-actions Bot added arrow Changes to the arrow crate arrow-data labels Sep 1, 2026

@Rich-T-kid Rich-T-kid 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.

This PR seems to have introduces a bug in test_struct_array_from_data_with_offset_and_length_error

@jaideeppyne
jaideeppyne force-pushed the fix/struct-arraydata-parent-offset branch from bbd1db5 to 79b9203 Compare September 1, 2026 14:59
@jaideeppyne

Copy link
Copy Markdown
Contributor Author

Fixed in 79b9203. I updated the struct ArrayData offset/length regression expectation so it now asserts the new validation error instead of expecting the old late panic. Local validation passed (cargo test -p arrow-array test_struct_array_from_data_with_offset_and_length_error --lib, cargo test -p arrow-data --lib, cargo fmt --check), and the GitHub checks are now green.

@Rich-T-kid Rich-T-kid 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.

looks good to me.

@jaideeppyne

Copy link
Copy Markdown
Contributor Author

Thanks for the review.

Comment thread arrow-array/src/array/struct_array.rs Outdated
Comment thread arrow-data/src/data.rs Outdated
@Jefffrey Jefffrey added the bug label Sep 2, 2026
@Jefffrey
Jefffrey merged commit 027b45f into apache:main Sep 2, 2026
40 checks passed
@Jefffrey

Jefffrey commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

thanks @jaideeppyne & @Rich-T-kid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

struct arraydata edge cases when offsets != 0

3 participants