kgyrtkirk commented on code in PR #16231:
URL: https://github.com/apache/druid/pull/16231#discussion_r1549450440


##########
processing/src/main/java/org/apache/druid/query/rowsandcols/semantic/DefaultFramedOnHeapAggregatable.java:
##########
@@ -434,7 +434,9 @@ private AppendableRowsAndColumns 
computeCumulativeAggregates(AggregatorFactory[]
     // a specialized implementation of this interface against, say, a Frame 
object that can deal with arrays instead
     // of trying to optimize this generic implementation.
     Object[][] results = new Object[aggFactories.length][numRows];
-    int resultStorageIndex = 0;
+
+    // if the upper offset is -ve, then we need to ignore those many rows 
prior to the current row
+    int resultStorageIndex = -1 * Math.min(upperOffset, 0);

Review Comment:
   nit: why not use an unary `-` ? 



-- 
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: commits-unsubscr...@druid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to