clintropolis commented on code in PR #17565:
URL: https://github.com/apache/druid/pull/17565#discussion_r1884592374
##########
processing/src/main/java/org/apache/druid/query/topn/Generic1AggPooledTopNScannerPrototype.java:
##########
@@ -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()) {
Review Comment:
yea, i did it as an if statement wrapping the loop so we wouldn't need to
check `currentOffsetWithinBucket()` twice per loop since the granularizer
advance methods also call `currentOffsetWithinBucket`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]