Skip to content

Fix MutableBuffer::clear#9622

Merged
alamb merged 2 commits intoapache:mainfrom
Rafferty97:fix-arrow-buffer-clear
Mar 31, 2026
Merged

Fix MutableBuffer::clear#9622
alamb merged 2 commits intoapache:mainfrom
Rafferty97:fix-arrow-buffer-clear

Conversation

@Rafferty97
Copy link
Copy Markdown
Contributor

@Rafferty97 Rafferty97 commented Mar 29, 2026

Which issue does this PR close?

Rationale for this change

In a previous PR (#9593), I change instances of truncate(0) to clear(). However, this breaks the test test_truncate_with_pool at arrow-buffer/src/buffer/mutable.rs:1357, due to an inconsistency between the implementation of truncate and clear. This PR fixes that test.

What changes are included in this PR?

This PR copies a section of code related to the pool feature present in truncate but absent in clear, fixing the failing unit test.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

inconsistency between `MutableBuffer::truncate` and
`MutableBuffer::clear`.
@github-actions github-actions bot added parquet Changes to the parquet crate arrow Changes to the arrow crate labels Mar 29, 2026
Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good -- thank you @Rafferty97

@alamb alamb merged commit 1a169cd into apache:main Mar 31, 2026
29 of 30 checks passed
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 parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants