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

List Auxiliary Buffer NullMask Fix #3156

Merged
merged 2 commits into from
Mar 27, 2024
Merged

List Auxiliary Buffer NullMask Fix #3156

merged 2 commits into from
Mar 27, 2024

Conversation

mxwli
Copy link
Collaborator

@mxwli mxwli commented Mar 27, 2024

The List Auxiliary Buffer allocates 64 times the necessary amount of null bitmap memory when resizing the buffer. This one-line change was made in its own PR so as to be easy to revert.

@@ -52,7 +52,9 @@ void ListAuxiliaryBuffer::resizeDataVector(ValueVector* dataVector) {
auto buffer = std::make_unique<uint8_t[]>(capacity * dataVector->getNumBytesPerValue());
memcpy(buffer.get(), dataVector->valueBuffer.get(), size * dataVector->getNumBytesPerValue());
dataVector->valueBuffer = std::move(buffer);
dataVector->nullMask->resize(capacity); // note: allocating 64 times what is needed
dataVector->nullMask->resize(
Copy link
Contributor

Choose a reason for hiding this comment

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

can u check if we are making the same mistake in other places when resizing nullMask? If so, this logic should be hidden inside NullMask class it self.

Copy link
Collaborator Author

@mxwli mxwli Mar 27, 2024

Choose a reason for hiding this comment

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

I ran "Find All References" in VSCode and the only result that came up was this instance. The function is probably only used here.
More generally, the main problem is that NullMask refers to capacity in the int64 sense, rather than in the bitmap sense. For example, the capacity passed to the constructor specifies its size in int64 chunks, so it would make more sense to change everything to bitmap.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think int64 chunks or vector matters on this problem. We should encapsulate the details inside NullMask, so the best way is to modify resize function accordingly.

Copy link

codecov bot commented Mar 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.08%. Comparing base (73ed1ea) to head (8dd8c1c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3156   +/-   ##
=======================================
  Coverage   92.08%   92.08%           
=======================================
  Files        1168     1168           
  Lines       44065    44065           
=======================================
  Hits        40577    40577           
  Misses       3488     3488           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mxwli mxwli merged commit 677d35e into master Mar 27, 2024
17 checks passed
@mxwli mxwli deleted the listauxiliarybuffer-fix branch March 27, 2024 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants