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: correctly copy null buffer when making deep copy #3238

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

westonpace
Copy link
Contributor

In some situations an array could be sliced in such a way that the array had no offset, but the array's null buffer did have an offset. In these cases we were not deep copying the array correctly and the offset of the null buffer was lost. This does mean, in some cases, the 2.0 writer could write incorrect nulls. However, the input conditions would mean that the user's data would have to originate from rust in such a way that it was sliced like this. It would be impossible for batches from the C data interface or from python to look like this.

@github-actions github-actions bot added bug Something isn't working python labels Dec 12, 2024
@westonpace
Copy link
Contributor Author

westonpace commented Dec 12, 2024

The reason had become a problem (and the reason the test case is testing scalar indices) is that we started using 2.0 to write our scalar indices. The input for 2.0 is the output of a datafusion sort plan which caused the data to be sliced in this way.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.49%. Comparing base (ef9d0c2) to head (cc22232).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3238      +/-   ##
==========================================
+ Coverage   78.45%   78.49%   +0.04%     
==========================================
  Files         244      245       +1     
  Lines       84554    85065     +511     
  Branches    84554    85065     +511     
==========================================
+ Hits        66333    66772     +439     
- Misses      15418    15478      +60     
- Partials     2803     2815      +12     
Flag Coverage Δ
unittests 78.49% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@westonpace westonpace merged commit 99ae761 into lancedb:main Dec 13, 2024
23 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants