abhishekagarwal87 commented on code in PR #15402:
URL: https://github.com/apache/druid/pull/15402#discussion_r1400152509


##########
processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java:
##########
@@ -651,9 +650,10 @@ public ResultRow apply(Object input)
             );
 
             if (isResultLevelCache) {
-              Iterator<PostAggregator> postItr = 
query.getPostAggregatorSpecs().iterator();
-              int postPos = 0;
-              while (postItr.hasNext() && results.hasNext()) {
+              for (int postPos = 0; postPos < 
query.getPostAggregatorSpecs().size(); postPos++) {
+                if (!results.hasNext()) {
+                  throw new ISE("Ran out of objects while reading postaggs 
from cache!");

Review Comment:
   can use DruidException.defensive instead. 



-- 
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]

Reply via email to