[ 
https://issues.apache.org/jira/browse/HIVE-24139?focusedWorklogId=481548&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-481548
 ]

ASF GitHub Bot logged work on HIVE-24139:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Sep/20 16:07
            Start Date: 10/Sep/20 16:07
    Worklog Time Spent: 10m 
      Work Description: mustafaiman commented on a change in pull request #1481:
URL: https://github.com/apache/hive/pull/1481#discussion_r486463497



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorGroupByOperator.java
##########
@@ -427,8 +428,12 @@ public void initialize(Configuration hconf) throws 
HiveException {
       computeMemoryLimits();
       LOG.debug("using hash aggregation processing mode");
 
+      reusableBufferSize = (int) (maxHtEntries * percentEntriesToFlush);
+
+      reusableAggregationBufferRows = new ArrayDeque<>(reusableBufferSize);
+
       if (keyWrappersBatch.getVectorHashKeyWrappers()[0] instanceof 
VectorHashKeyWrapperGeneral) {

Review comment:
       @rbalamohan 
   The array that is returned from 
`keyWrappersBatch.getVectorHashKeyWrappers()` consists of only one type of 
wrappers, isn't it? So the first element is representative of all the elements 
in that array.
   
   We resort to this optimization only when the batch consists of 
VectorHashKeyWrapperGeneral. The other wrapper types have only one two 
primitive types. If needed, only thing we need to do is just override their 
copyKey(KeyWrapper) method and generalize this `instanceOf` check to cover them 
too. Right now, I dont think that is very important.
   
   So when the first element is not VectorHashKeyWrapperGeneral, the rest of 
the array are not either. In that case, we just skip reusing.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 481548)
    Time Spent: 0.5h  (was: 20m)

> VectorGroupByOperator is not flushing hash table entries as needed
> ------------------------------------------------------------------
>
>                 Key: HIVE-24139
>                 URL: https://issues.apache.org/jira/browse/HIVE-24139
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Mustafa Iman
>            Assignee: Mustafa Iman
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> After https://issues.apache.org/jira/browse/HIVE-23975 introduced a bug where 
> copyKey mutates some key wrappers while copying. This Jira is to fix it.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to