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

Fix NullBufferBuilder::new_from_buffer wrong size assertion #5489

Merged
merged 2 commits into from
Mar 10, 2024

Conversation

Kikkon
Copy link
Contributor

@Kikkon Kikkon commented Mar 9, 2024

Which issue does this PR close?

Closes #5445.

Rationale for this change

Avoid panic with the following code

        let mut builder = Int32Builder::new();
        for i in 0..64 {
            if i % 2 == 0 {
                builder.append_null();
            } else {
                builder.append_value(i as i32); 
            }
        }
        let array = builder.finish();
        let _ = array.into_builder().expect("into_builder");

What changes are included in this PR?

Are there any user-facing changes?

no

@github-actions github-actions bot added the arrow Changes to the arrow crate label Mar 9, 2024
@tustvold
Copy link
Contributor

tustvold commented Mar 9, 2024

Could we get a test please, e.g. the PR description

@Kikkon
Copy link
Contributor Author

Kikkon commented Mar 10, 2024

Could we get a test please, e.g. the PR description

Of course, I have already added the test.

@tustvold tustvold merged commit 94da02f into apache:master Mar 10, 2024
25 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong size assertion in arrow_buffer::builder::NullBufferBuilder::new_from_buffer
2 participants