You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "neilconway (via GitHub)" <gi...@apache.org> on 2026/09/30 21:01:23 UTC
[PR] fix(arrow-array): avoid returning corrupt array in `GenericByteArray::into_builder` [arrow-rs]
neilconway opened a new pull request, #11311:
URL: https://github.com/apache/arrow-rs/pull/11311
# Which issue does this PR close?
- N/A
# Rationale for this change
`GenericByteArray::into_builder` attempts to convert the byte array into a builder without copying the underlying buffers, returning an error if that cannot be done. When it was called with a sliced array whose first offset was non-zero, it returned a corrupted array whose offsets pointed past the underlying values array.
To fix this, refactor `into_builder` so that it avoids modifying the values array until we are sure that `into_builder` will succeed.
Along the way, we arrange to copy the input null buffer if it can't be reused; the null buffer is small, so it doesn't seem worth forcing the caller to copy the rest of the array fields if the array could otherwise be reused.
# What changes are included in this PR?
* Refactor `GenericByteArray::into_builder` and fix bug, as described above
* Add unit tests
* Adjust `GenericByteBuilder::new_from_buffer` to truncate any bytes in the buffer beyond the last offset
# Are these changes tested?
Yes; existing tests pass, new unit tests added.
# Are there any user-facing changes?
No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(arrow-array): avoid returning corrupt array in `GenericByteArray::into_builder` [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on PR #11311:
URL: https://github.com/apache/arrow-rs/pull/11311#issuecomment-5944435212
thanks @neilconway
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(arrow-array): avoid returning corrupt array in `GenericByteArray::into_builder` [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey merged PR #11311:
URL: https://github.com/apache/arrow-rs/pull/11311
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org