Github user ppadma commented on a diff in the pull request:
https://github.com/apache/drill/pull/1228#discussion_r184258865
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchSizer.java
---
@@ -536,6 +556,11 @@ public ColumnSize getColumn(String name) {
*/
private int netRowWidth;
private int netRowWidthCap50;
+
+ /**
+ * actual row size if input is not empty. Otherwise, standard size.
+ */
+ private int rowAllocSize;
--- End diff --
actually, this is a problem only for lateral join. In lateral join, right
side will work on one row at a time from left side. If right side produces zero
rows because of empty array or some other reason, for left outer join, we still
have to finish cross join for that row from left side by having nulls for right
side columns. Then, we go to next row on left side, continuing to work on
filling the output batch till it is full. What that means is we have to
allocate vectors based on that first batch on right side, which can be empty.
---