Github user ppadma commented on a diff in the pull request:
https://github.com/apache/drill/pull/1227#discussion_r183108078
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java
---
@@ -300,13 +322,14 @@ public void setupHashTable() throws IOException,
SchemaChangeException, ClassTra
public void executeBuildPhase() throws SchemaChangeException,
ClassTransformationException, IOException {
//Setup the underlying hash table
-
// skip first batch if count is zero, as it may be an empty schema
batch
if (isFurtherProcessingRequired(rightUpstream) &&
right.getRecordCount() == 0) {
for (final VectorWrapper<?> w : right) {
w.clear();
}
rightUpstream = next(right);
+ // For build side, use aggregate i.e. average row width across
batches
+ batchMemoryManager.update(RIGHT_INDEX, 0,true);
--- End diff --
There is a call to "next" right above the update.
---