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

Clear row buffer before reuse #4742

Merged
merged 2 commits into from
Aug 27, 2023
Merged

Clear row buffer before reuse #4742

merged 2 commits into from
Aug 27, 2023

Conversation

yjshen
Copy link
Member

@yjshen yjshen commented Aug 26, 2023

Which issue does this PR close?

Closes #4741.

Rationale for this change

When reusing rows buffer, previous rows' fixed-length field content isn't cleared, causing the Row to become incomparable if a null value is written for the new row.

What changes are included in this PR?

Fill the Rows buffer with zero to keep the row comparable after buffer reuse.

Are there any user-facing changes?

No.

@github-actions github-actions bot added the arrow Changes to the arrow crate label Aug 26, 2023
@@ -981,6 +981,9 @@ impl Rows {
/// Sets the length of this [`Rows`] to 0
pub fn clear(&mut self) {
self.offsets.truncate(1);
unsafe {
Copy link
Contributor

Choose a reason for hiding this comment

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

self.buffer.clear()` I think would achieve the same thing?

@tustvold tustvold merged commit 4888dbf into apache:master Aug 27, 2023
@tustvold
Copy link
Contributor

Thank you

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.

Row is no longer comparable after reuse
2 participants