You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "shuozel (via GitHub)" <gi...@apache.org> on 2025/02/12 05:47:56 UTC
[PR] fix: NullBufferBuilder::allocated_size should return Size in Bytes [arrow-rs]
shuozel opened a new pull request, #7122:
URL: https://github.com/apache/arrow-rs/pull/7122
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #7121.
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
Refer to the comment from @tustvold in [issue#7121](https://github.com/apache/arrow-rs/pull/7121)
"Given no reasonable allocator allocates memory in bits, it is somewhat expected that the quantity returned is in bytes, and returning in bits is a bug."
# What changes are included in this PR?
Updates the `NullBufferBuilder::allocated_size` function to return the size in bytes.
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!---
If there are any breaking changes to public APIs, please call them out.
-->
This change will break public API usage of `NullBufferBuilder::allocated_size`:
- the returned size after this change will be different from the size returned before (1/8 of the original value).
--
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: NullBufferBuilder::allocated_size should return Size in Bytes [arrow-rs]
Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #7122:
URL: https://github.com/apache/arrow-rs/pull/7122#issuecomment-2653488738
I personally think this is a bug and therefore not a breaking change, but curious what others think
E.g. @alamb
--
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: NullBufferBuilder::allocated_size should return Size in Bytes [arrow-rs]
Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #7122:
URL: https://github.com/apache/arrow-rs/pull/7122#issuecomment-2653528271
> the docs state that this returns bits, so the current behaviour is as expected for users
The docs haven't actually been released yet, the current released docs state it is in bytes - https://docs.rs/arrow-buffer/latest/arrow_buffer/builder/struct.NullBufferBuilder.html#method.allocated_size
--
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: NullBufferBuilder::allocated_size should return Size in Bytes [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7122:
URL: https://github.com/apache/arrow-rs/pull/7122#issuecomment-2653999276
Thanks @mbrobbel and @tustvold
--
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: NullBufferBuilder::allocated_size should return Size in Bytes [arrow-rs]
Posted by "mbrobbel (via GitHub)" <gi...@apache.org>.
mbrobbel commented on PR #7122:
URL: https://github.com/apache/arrow-rs/pull/7122#issuecomment-2653523012
> I personally think this is a bug and therefore not a breaking change, but curious what others think
>
> E.g. @alamb
I think we should mark this as a breaking change. I agree that it was wrong to return number of bits here, but the docs state that this returns bits, so the current behaviour is as expected for users. If this said bytes and returned bits (or the other way around) I think this would be a non-breaking bug fix, but now we're changing semantics, which is not expected for a non-breaking change.
An alternative would be to mark this as deprecated and introduce another method that returns bytes. Then this can be removed, after which we can deprecate the new method and re-introduce this as bytes again.
--
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: NullBufferBuilder::allocated_size should return Size in Bytes [arrow-rs]
Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold merged PR #7122:
URL: https://github.com/apache/arrow-rs/pull/7122
--
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: NullBufferBuilder::allocated_size should return Size in Bytes [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7122:
URL: https://github.com/apache/arrow-rs/pull/7122#issuecomment-2653999866
And @shuozel !
--
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: NullBufferBuilder::allocated_size should return Size in Bytes [arrow-rs]
Posted by "mbrobbel (via GitHub)" <gi...@apache.org>.
mbrobbel commented on PR #7122:
URL: https://github.com/apache/arrow-rs/pull/7122#issuecomment-2653532515
> > the docs state that this returns bits, so the current behaviour is as expected for users
>
> The docs haven't actually been released yet, the current released docs state it is in bytes - https://docs.rs/arrow-buffer/latest/arrow_buffer/builder/struct.NullBufferBuilder.html#method.allocated_size
>
> The docs were changed in #7089 to reflect the actual state
Ah, in that case I agree with you.
--
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