Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Encoding of List offsets was incorrect when slice offsets begin … #6954

Closed
wants to merge 1 commit into from

Conversation

alexwilcoxson-rel
Copy link
Contributor

…with zero (#6805)

  • fix: Encoding of List offsets was incorrect when slice offsets begin with zero

When encoding offsets the code had an optimization to reuse the offsets if the first offset was zero assuming the slice already pointed
to first element. But the offset can also be zero if all previous lists were empty. When this occured it mold make all lists in the
slice as empty, even if they shouldn't be.

  • Use Buffer::from_slice_ref which will be faster as it doesn't iterate through the slice.

  • Avoid copying

  • Explicitly reference std::mem::size_of

(cherry picked from commit fe7e71a)

Which issue does this PR close?

Closes #.

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

…with zero (apache#6805)

* fix: Encoding of List offsets was incorrect when slice offsets begin with zero

When encoding offsets the code had an optimization to reuse the offsets if the first offset was zero assuming the slice already pointed
 to first element. But the offset can also be zero if all previous lists were empty. When this occured it mold make all lists in the
slice as empty, even if they shouldn't be.

* Use Buffer::from_slice_ref which will be faster as it doesn't iterate through the slice.

* Avoid copying

* Explicitly reference std::mem::size_of

(cherry picked from commit fe7e71a)
@github-actions github-actions bot added the arrow Changes to the arrow crate label Jan 8, 2025
@alexwilcoxson-rel alexwilcoxson-rel deleted the pick-slice-fix branch January 8, 2025 17:39
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants