ilooner closed pull request #1472: DRILL-6747: Fixed IOB in HashJoin for inner and right joins on empty probe side URL: https://github.com/apache/drill/pull/1472
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/unorderedreceiver/UnorderedReceiverBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/unorderedreceiver/UnorderedReceiverBatch.java index 424a733bb63..8cdc0a1c78a 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/unorderedreceiver/UnorderedReceiverBatch.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/unorderedreceiver/UnorderedReceiverBatch.java @@ -174,7 +174,7 @@ public IterOutcome next() { first = false; if (batch == null) { - batchLoader.clear(); + batchLoader.zero(); if (!context.getExecutorState().shouldContinue()) { return IterOutcome.STOP; } diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java index b44a3629211..c65827c2be6 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java @@ -115,6 +115,14 @@ * This value will be returned only after {@link #OK_NEW_SCHEMA} has been * returned at least once (not necessarily <em>immediately</em> after). * </p> + * <p> + * Also after a RecordBatch returns NONE a RecordBatch should: + * <ul> + * <li>Contain the last valid schema seen by the operator.</li> + * <li>Contain a VectorContainer with empty columns corresponding to the last valid schema.</li> + * <li>Return a record count of 0.</li> + * </ul> + * </p> */ NONE(false), diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java b/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java index bea7cb503fe..e841f2f3bc0 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java @@ -276,6 +276,14 @@ public SelectionVector4 getSelectionVector4() { public void resetRecordCount() { valueCount = 0; } + /** + * Removes an data from the loader, but maintains the schema and empty vectors. + */ + public void zero() { + container.zeroVectors(); + resetRecordCount(); + } + /** * Clears this loader, which clears the internal vector container (see * {@link VectorContainer#clear}) and resets the record count to zero. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services