[
https://issues.apache.org/jira/browse/DRILL-6310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16517757#comment-16517757
]
ASF GitHub Bot commented on DRILL-6310:
---------------------------------------
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_r196638377
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/HashAggTemplate.java
##########
@@ -193,17 +201,43 @@ public int metricId() {
}
}
+ // Given hashtable index, figure out the corresponding index in the batch.
+ public int idxInBatch(int parition, int idx) {
+ int totalSize = 0;
+ for (int i=0; i < batchHolders[parition].size(); i++) {
+ if (idx < (totalSize + batchHolders[parition].get(i).batchSize)) {
+ return (idx - totalSize);
+ }
+ totalSize += batchHolders[parition].get(i).batchSize;
+ }
+ throw new IllegalArgumentException("idx must be less than total size");
+ }
+
+ // Given hashtable index, figure out the corresponding batch.
+ public int idxOfBatch(int partition, int idx) {
+ int totalSize = 0;
+ for (int i=0; i < batchHolders[partition].size(); i++) {
+ totalSize += batchHolders[partition].get(i).batchSize;
+ if (idx < totalSize) {
+ return i;
+ }
+ }
+ throw new IllegalArgumentException("idx must be less than total size");
+ }
+
public class BatchHolder {
private VectorContainer aggrValuesContainer; // container for aggr values
(workspace variables)
private int maxOccupiedIdx = -1;
- private int batchOutputCount = 0;
+ private int batchSize = 0;
Review comment:
The word **size** causes some confusion (e.g. size in bytes ?); this is why
**count** was originally chosen.
----------------------------------------------------------------
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]
> limit batch size for hash aggregate
> -----------------------------------
>
> Key: DRILL-6310
> URL: https://issues.apache.org/jira/browse/DRILL-6310
> Project: Apache Drill
> Issue Type: Improvement
> Components: Execution - Flow
> Affects Versions: 1.13.0
> Reporter: Padma Penumarthy
> Assignee: Padma Penumarthy
> Priority: Major
> Fix For: 1.14.0
>
>
> limit batch size for hash aggregate based on memory.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)