Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/1125#discussion_r172103839
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
---
@@ -492,8 +504,12 @@ private void allocateBatch(boolean newSchema) {
} else {
container.zeroVectors();
}
+
+ // Allocate memory for the vectors.
+ // This will iteratively allocate memory for all nested columns
underneath.
for (VectorWrapper w : container) {
- AllocationHelper.allocateNew(w.getValueVector(),
Character.MAX_VALUE);
+ RecordBatchSizer.ColumnSize colSize =
mergeJoinMemoryManager.getColumnSize(w.getField().getName());
+ colSize.allocateVector(w.getValueVector(),
mergeJoinMemoryManager.getOutputRowCount());
--- End diff --
Nice! Much simpler. Just one nit: might as well get the row count once and
store it in a local variable to avoid getting the same number repeatedly.
---