drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From par...@apache.org
Subject [4/4] drill git commit: DRILL-1743: check capacity before writing into map vector
Date Thu, 27 Nov 2014 17:32:05 GMT
DRILL-1743: check capacity before writing into map vector


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

Branch: refs/heads/master
Commit: 3119011df44d28d7590de6613f536d64366a1736
Parents: a94a028
Author: Hanifi Gunes <hgunes@maprtech.com>
Authored: Wed Nov 19 18:06:01 2014 -0800
Committer: Parth Chandra <pchandra@maprtech.com>
Committed: Wed Nov 26 14:54:36 2014 -0800

----------------------------------------------------------------------
 .../java-exec/src/main/codegen/templates/MapWriters.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/3119011d/exec/java-exec/src/main/codegen/templates/MapWriters.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/codegen/templates/MapWriters.java b/exec/java-exec/src/main/codegen/templates/MapWriters.java
index 1fdb4db..b8bd73e 100644
--- a/exec/java-exec/src/main/codegen/templates/MapWriters.java
+++ b/exec/java-exec/src/main/codegen/templates/MapWriters.java
@@ -129,16 +129,16 @@ public class ${mode}MapWriter extends AbstractFieldWriter{
     }
   }
   
-  
+
   public void end(){
     // noop
   }
   <#else>
-  
+
   public void setValueCount(int count){
     container.getMutator().setValueCount(count);
   }
-  
+
   public void setPosition(int index){
     super.setPosition(index);
     for(FieldWriter w: fields.values()){
@@ -146,7 +146,10 @@ public class ${mode}MapWriter extends AbstractFieldWriter{
     }
   }
   public void start(){
-    // noop
+    // check capacity only after we have a non empty container
+    if(container.size() > 0 && ok()) {
+      checkValueCapacity();
+    }
   }
   
   public void end(){


Mime
View raw message