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

UnionSourceManager: Do Not Generate Shifts on Empty Constituents #3610

Merged
merged 7 commits into from
Mar 28, 2023

Conversation

nbauernfeind
Copy link
Member

@nbauernfeind nbauernfeind commented Mar 28, 2023

@nbauernfeind nbauernfeind added bug Something isn't working query engine NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed. labels Mar 28, 2023
@nbauernfeind nbauernfeind added this to the Mar 2023 milestone Mar 28, 2023
@nbauernfeind nbauernfeind self-assigned this Mar 28, 2023
if (slotAllocationChanged) {
currFirstRowKeys[nextCurrentSlot + 1] = checkOverflow(nextSlotPrevFirstRowKey + shiftDelta);
resultRows.insertWithShift(currFirstRowKey, constituent.getRowSet());
if (shiftDelta != 0) {
// don't bother shifting if the constituent is empty
if (shiftDelta != 0 && constituent.size() > 0) {
Copy link
Member

Choose a reason for hiding this comment

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

We should move the line above (insertWithShift) into this if block.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is shiftDelta guaranteed to be non-zero here? We clear resultRows past the first shifted row when we set slotAllocationChanged to true. If it is valid for shiftDelta to be zero, then we must add the constituent to the result set unconditionally.

I'll drop the shiftDelta of zero check. I believe with your partition table related changes that constituents can be removed causing negative shifts; and thus a shift of zero is possible. However, shiftRange does ignore shifts of zero.

nbauernfeind and others added 3 commits March 27, 2023 21:31
…ces/UnionSourceManager.java

Co-authored-by: Ryan Caudy <rcaudy@gmail.com>
…Table.java

Co-authored-by: Ryan Caudy <rcaudy@gmail.com>
…ces/UnionSourceManager.java

Co-authored-by: Ryan Caudy <rcaudy@gmail.com>
@nbauernfeind nbauernfeind merged commit f8d51ea into deephaven:main Mar 28, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed. query engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merging of Stream Tables should not generate shifts.
2 participants