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_r199274859
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/HashTableTemplate.java
##########
@@ -684,7 +694,7 @@ public PutStatus put(int incomingRowIdx, IndexPointer
htIdxHolder, int hashCode,
}
htIdxHolder.value = currentIdx;
return addedBatch ? PutStatus.NEW_BATCH_ADDED :
- (freeIndex + 1 > (batchHolders.size() * BATCH_SIZE)) ?
+ (freeIndex + 1 > totalIndexSize) ?
Review comment:
Problem: The original code "overflew" the (64K - 1) by adding one, hence
this check returned KEY_ADDED_LAST, which signaled to the caller that a batch
just got filled -- a good opportunity to check if need to spill (since a new
batch would surely be allocated soon).
By going below 64K, this would not work, hence the code misses on some of
the checks of "is spill needed now".
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services