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

NullBufferBuilder::allocated_size Returns Size in Bits #7121

Closed
tustvold opened this issue Feb 11, 2025 · 3 comments · Fixed by #7122
Closed

NullBufferBuilder::allocated_size Returns Size in Bits #7121

tustvold opened this issue Feb 11, 2025 · 3 comments · Fixed by #7122
Labels
arrow Changes to the arrow crate bug documentation Improvements or additions to documentation good first issue Good for newcomers help wanted

Comments

@tustvold
Copy link
Contributor

Describe the bug

As documented in #7089, NullBufferBuilder::allocated_size returns the size in bits. 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.

To Reproduce

Expected behavior

The value should be in bytes.

Additional context

This was added in #6047 by @XiangpengHao

@shuozel
Copy link
Contributor

shuozel commented Feb 12, 2025

It seems the NullBufferBuilder is calling the BooleanBufferBuilder.capacity() here 1, and we are directly returning the capacity in bits returend by the BooleanBufferBuilder.

Just wanna confirm, we should only make the change to the NullBufferBuilder.capacity() to return the capacity in bytes and leave the BooleanBufferBuilder.capacity() unchanged to return the capacity in bits. Please correct me if my understanding is incorrect.

@alamb
Copy link
Contributor

alamb commented Feb 12, 2025

label_issue.py automatically added labels {'arrow'} from #7104

@alamb alamb added the documentation Improvements or additions to documentation label Feb 12, 2025
@alamb
Copy link
Contributor

alamb commented Feb 12, 2025

label_issue.py automatically added labels {'documentation'} from #7089

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 bug documentation Improvements or additions to documentation good first issue Good for newcomers help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants