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_r198962585
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/HashTableTemplate.java
##########
@@ -683,7 +683,7 @@ public PutStatus put(int incomingRowIdx, IndexPointer
htIdxHolder, int hashCode)
}
htIdxHolder.value = currentIdx;
return addedBatch ? PutStatus.NEW_BATCH_ADDED :
- ( freeIndex + 1 > totalBatchHoldersSize /* batchHolders.size() *
BATCH_SIZE */ ) ?
+ (freeIndex + 1 > (batchHolders.size() * BATCH_SIZE)) ?
Review comment:
A small issue of performance: Both this code (and also *addBatchIfNeeded()*
below) are executed per each row !! Hence little overheads (like these
multiplications) add up.
When the original batch size was 64K, the use of a single 4-byte index
(where the upper 2 were the batch count) made sense; no more with this change.
Future suggestion: Replace each of these indices with two - a batch index
and an inside-batch index. This would reduce some of the calculations in the
"hot code".
----------------------------------------------------------------
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