-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
topn with granularity regression fixes #17565
Changes from all commits
ecd7a5c
76d1c6c
2f61031
3d986f1
129f381
63c4376
f8f07dd
d4fcf84
9ba9679
9728e6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -391,7 +391,7 @@ public boolean hasNext() | |
if (delegate != null && delegate.hasNext()) { | ||
return true; | ||
} else { | ||
if (!cursor.isDone() && granularizer.currentOffsetWithinBucket()) { | ||
if (granularizer.currentOffsetWithinBucket()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea, i noticed granularizer.currentOffsetWithinBucket also checks isDone so it seemed nicer this way, this didn't cause any issues, just noticed while i was looking over stuff |
||
if (delegate != null) { | ||
delegate.close(); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,25 +54,27 @@ public long scanAndAggregate( | |
{ | ||
long processedRows = 0; | ||
int positionToAllocate = 0; | ||
while (!cursor.isDoneOrInterrupted()) { | ||
final IndexedInts dimValues = dimensionSelector.getRow(); | ||
final int dimSize = dimValues.size(); | ||
for (int i = 0; i < dimSize; i++) { | ||
int dimIndex = dimValues.get(i); | ||
int position = positions[dimIndex]; | ||
if (position >= 0) { | ||
aggregator.aggregate(resultsBuffer, position); | ||
} else if (position == TopNAlgorithm.INIT_POSITION_VALUE) { | ||
positions[dimIndex] = positionToAllocate; | ||
position = positionToAllocate; | ||
aggregator.init(resultsBuffer, position); | ||
aggregator.aggregate(resultsBuffer, position); | ||
positionToAllocate += aggregatorSize; | ||
if (granularizer.currentOffsetWithinBucket()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea, this was a bug, i did it as an if statement wrapping the loop so we wouldn't need to check |
||
while (!cursor.isDoneOrInterrupted()) { | ||
final IndexedInts dimValues = dimensionSelector.getRow(); | ||
final int dimSize = dimValues.size(); | ||
for (int i = 0; i < dimSize; i++) { | ||
int dimIndex = dimValues.get(i); | ||
int position = positions[dimIndex]; | ||
if (position >= 0) { | ||
aggregator.aggregate(resultsBuffer, position); | ||
} else if (position == TopNAlgorithm.INIT_POSITION_VALUE) { | ||
positions[dimIndex] = positionToAllocate; | ||
position = positionToAllocate; | ||
aggregator.init(resultsBuffer, position); | ||
aggregator.aggregate(resultsBuffer, position); | ||
positionToAllocate += aggregatorSize; | ||
} | ||
} | ||
processedRows++; | ||
if (!granularizer.advanceCursorWithinBucketUninterruptedly()) { | ||
break; | ||
} | ||
} | ||
processedRows++; | ||
if (!granularizer.advanceCursorWithinBucketUninterruptedly()) { | ||
break; | ||
} | ||
} | ||
return processedRows; | ||
|
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.
@clintropolis Do we need this field ?
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.
#17579