Github user Ben-Zvi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1227#discussion_r182919074
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchMemoryManager.java
 ---
    @@ -241,4 +261,41 @@ public int getOutputBatchSize() {
       public int getOffsetVectorWidth() {
         return UInt4Vector.VALUE_WIDTH;
       }
    +
    +  public void allocateVectors(VectorContainer container) {
    +    // Allocate memory for the vectors.
    +    // This will iteratively allocate memory for all nested columns 
underneath.
    +    for (VectorWrapper w : container) {
    +      RecordBatchSizer.ColumnSize colSize = 
getColumnSize(w.getField().getName());
    +      colSize.allocateVector(w.getValueVector(), outputRowCount);
    +    }
    +  }
    +
    +  public void allocateVectors(VectorContainer container, int recordCount) {
    +    // Allocate memory for the vectors.
    +    // This will iteratively allocate memory for all nested columns 
underneath.
    +    for (VectorWrapper w : container) {
    +      RecordBatchSizer.ColumnSize colSize = 
getColumnSize(w.getField().getName());
    +      colSize.allocateVector(w.getValueVector(), recordCount);
    +    }
    +  }
    +
    +  public void allocateVectors(List<ValueVector> valueVectors) {
    +    // Allocate memory for the vectors.
    --- End diff --
    
    Same idea/comment as above; can avoid some duplicate code by calling 
allocateVectors(valueVectors, outputRecordCount) 
     



---

Reply via email to