[ 
https://issues.apache.org/jira/browse/DRILL-6126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16385719#comment-16385719
 ] 

ASF GitHub Bot commented on DRILL-6126:
---------------------------------------

Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1125#discussion_r172105435
  
    --- Diff: 
exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedMapVector.java
 ---
    @@ -608,4 +608,22 @@ public void collectLedgers(Set<BufferLedger> ledgers) {
       public void toNullable(ValueVector nullableVector) {
         throw new UnsupportedOperationException();
       }
    +
    +  @Override
    +  public int getPayloadByteCount(int valueCount) {
    +    if (valueCount == 0) {
    +      return 0;
    +    }
    +
    +    int count = 0;
    +
    +    int entryCount = offsets.getAccessor().get(valueCount);
    +    count += offsets.getPayloadByteCount(valueCount);
    --- End diff --
    
    ```
    int count = offsets.get...
    ```


> Allocate memory for value vectors upfront in flatten operator
> -------------------------------------------------------------
>
>                 Key: DRILL-6126
>                 URL: https://issues.apache.org/jira/browse/DRILL-6126
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Padma Penumarthy
>            Assignee: Padma Penumarthy
>            Priority: Critical
>             Fix For: 1.12.0
>
>
> With recent changes to control batch size for flatten operator, we figure out 
> row count in the output batch based on memory. Since we know how many rows we 
> are going to include in the batch, we can also allocate the memory needed 
> upfront instead of starting with initial value (4096) and doubling, copying 
> every time we need more. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to