Repository: incubator-drill Updated Branches: refs/heads/master 5b8f8d8c7 -> 01bf8496b
DRILL-831: Execute the probe phase for outer joins if the build side is empty (fix for NOT IN bug). Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/e6a66529 Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/e6a66529 Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/e6a66529 Branch: refs/heads/master Commit: e6a665298558ea4e6ae72b8efb9ce9c7a97d2680 Parents: 5b8f8d8 Author: Aman Sinha <[email protected]> Authored: Fri May 23 11:13:39 2014 -0700 Committer: Jacques Nadeau <[email protected]> Committed: Wed May 28 09:13:54 2014 -0700 ---------------------------------------------------------------------- .../org/apache/drill/exec/physical/impl/join/HashJoinBatch.java | 3 ++- .../drill/exec/physical/impl/join/HashJoinProbeTemplate.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/e6a66529/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java index 3b8d713..0edd3f0 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java @@ -170,7 +170,8 @@ public class HashJoinBatch extends AbstractRecordBatch<HashJoinPOP> { } // Store the number of records projected - if (hashTable != null) { + if (hashTable != null + || joinType != JoinRelType.INNER) { // Allocate the memory for the vectors in the output container allocateVectors(); http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/e6a66529/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java index 2a8be54..9c5b76a 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java @@ -128,11 +128,13 @@ public abstract class HashJoinProbeTemplate implements HashJoinProbe { recordsProcessed = 0; } } - int probeIndex; + int probeIndex = -1; // Check if we need to drain the next row in the probe side if (getNextRecord) { + if (hashTable != null) { probeIndex = hashTable.containsKey(recordsProcessed, true); + } if (probeIndex != -1) {
