DRILL-1080: Handle out of space condition in Hash join probe

Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/b8d45766
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/b8d45766
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/b8d45766

Branch: refs/heads/master
Commit: b8d457666de8ab3fd122e839d7553a094a2f44be
Parents: 70e71fc
Author: Steven Phillips <sphill...@maprtech.com>
Authored: Wed Jun 25 17:07:50 2014 -0700
Committer: Jacques Nadeau <jacq...@apache.org>
Committed: Thu Jun 26 09:02:12 2014 -0700

----------------------------------------------------------------------
 .../exec/physical/impl/join/HashJoinProbeTemplate.java  | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/b8d45766/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 21c4ae7..9c84e54 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
@@ -171,6 +171,7 @@ public abstract class HashJoinProbeTemplate implements 
HashJoinProbe {
             if(!success){
               // we failed to project.  redo this record.
               getNextRecord = false;
+              return;
             }else{
               outputRecords++;
 
@@ -197,8 +198,17 @@ public abstract class HashJoinProbeTemplate implements 
HashJoinProbe {
 
             // If we have a left outer join, project the keys
             if (joinType == JoinRelType.LEFT || joinType == JoinRelType.FULL) {
-              boolean success = projectProbeRecord(recordsProcessed, 
outputRecords++);
+              boolean success = projectProbeRecord(recordsProcessed, 
outputRecords);
+              if(!success){
+                if(outputRecords == 0){
+                  throw new IllegalStateException("Record larger than single 
batch.");
+                }else{
+                  // we've output some records but failed to output this one.  
return and wait for next call.
+                  return;
+                }
+              }
               assert success;
+              outputRecords++;
             }
             recordsProcessed++;
           }

Reply via email to