Ben-Zvi commented on a change in pull request #1324: DRILL-6310: limit batch size for hash aggregate URL: https://github.com/apache/drill/pull/1324#discussion_r199274012
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/HashTableTemplate.java ########## @@ -568,8 +576,10 @@ private void retryAfterOOM(boolean batchAdded) throws RetryAfterSpillException { if ( batchAdded ) { logger.trace("OOM - Removing index {} from the batch holders list",batchHolders.size() - 1); BatchHolder bh = batchHolders.remove(batchHolders.size() - 1); + prevIndexSize = batchHolders.size() > 1 ? (batchHolders.size()-1) * BATCH_SIZE : 0; + totalIndexSize = batchHolders.size() * BATCH_SIZE; // update freeIndex to point to end of last batch + 1 - freeIndex = batchHolders.size() * BATCH_SIZE + 1; + freeIndex = totalIndexSize + 1; Review comment: No need for "+ 1" -- the free index starts at batch offset of zero. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services