-
Notifications
You must be signed in to change notification settings - Fork 104
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 VersionInfo SelectionVector creation #4556
Conversation
One branch of the code was setting the existing SelectionVector to filtered and then appending to it Existing unfiltered elements would be discarded and replaced with whatever happened to be in the SelectionVector's mutable buffer
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4556 +/- ##
==========================================
- Coverage 87.35% 87.35% -0.01%
==========================================
Files 1349 1349
Lines 56584 56587 +3
Branches 7081 7079 -2
==========================================
+ Hits 49431 49433 +2
Misses 6981 6981
- Partials 172 173 +1 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Benchmark ResultMaster commit hash:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. LGTM!
One branch of the code was setting the existing SelectionVector to filtered and then appending to it Existing unfiltered elements would be discarded and replaced with whatever happened to be in the SelectionVector's mutable buffer
One branch of the code was setting the existing SelectionVector to filtered and then appending to it Existing unfiltered elements would be discarded and replaced with whatever happened to be in the SelectionVector's mutable buffer
Fixes #4271.
The issue was that
VersionInfo::getSelVectorForScan
(andVectorVersionInfo::getSelVectorForScan
) append repeatedly to aSelectionVector
and in certain circumstances it will turn a non-empty unfiltered SelectionVector into a filtered one without preserving the former values and then just appending to the end. My solution was to add a new makeDynamic function that copies the old selectedPositions into the mutable buffer before switching them.E.g. this can occur when the first few VectorVersionInfos have no deletions, such that the first branch is taken in
VectorVersionInfo::getSelVectorToScan
and it just increases the length of the unfiltered SelectionVector, but then later VectorVersionInfos have deletions, taking the second branch where there is no check for unfiltered data (since it has to be converted to filtered at that point).