Fix MutableArrayData::extend_nulls (#1230)#4343
Merged
tustvold merged 2 commits intoapache:masterfrom Jun 2, 2023
Merged
Conversation
tustvold
commented
Jun 2, 2023
|
|
||
| pub len: usize, | ||
| pub null_buffer: MutableBuffer, | ||
| pub null_buffer: Option<MutableBuffer>, |
Contributor
Author
There was a problem hiding this comment.
This does add a branch on append, in practice appending to a null mask is so branch heavy anyway, not to mention already involving a dyn dispatch, I struggle to see how this could have an appreciable performance impact
tustvold
commented
Jun 2, 2023
| let nulls = self.data.null_buffer(); | ||
| nulls.resize(bit_len, 0); | ||
| self.data.null_count += len; | ||
| (self.extend_nulls)(&mut self.data, len); |
Contributor
Author
There was a problem hiding this comment.
Despite its name this extends the values buffers with nulls, it doesn't do anything to the bit mask
…-data-extend-nulls
alamb
approved these changes
Jun 2, 2023
| /// Panics if [`MutableArrayData`] not created with `use_nulls` or nullable source arrays | ||
| /// | ||
| pub fn extend_nulls(&mut self, len: usize) { | ||
| // TODO: null_buffer should probably be extended here as well |
Contributor
Author
There was a problem hiding this comment.
Yup, I remember adding it at the same time as I created #1230 - I then completely forgot about it 😅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #1230
Closes #4324
Rationale for this change
MutableArrayData::extend_nulls doesn't update the null bitmask, and so has never worked correctly. Since #3775 it most likely will result in freeze panicking. It is surprising that nobody has hit this before, although we use
MutableArrayDatain very limited places, andMutableArrayData::extend_nullsin even fewer.What changes are included in this PR?
Are there any user-facing changes?