drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [16/16] incubator-drill git commit: DRILL-1661: Fix for setValueLengthSafe method in variable length vectors that was causing a failure in the parquet reader.
Date Sat, 08 Nov 2014 00:03:17 GMT
DRILL-1661: Fix for setValueLengthSafe method in variable length vectors that was causing a
failure in the parquet reader.


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

Branch: refs/heads/master
Commit: a8fd9758b1f77632a038e43c5ac2cc00e1fa459b
Parents: f7570d9
Author: Jason Altekruse <altekrusejason@gmail.com>
Authored: Mon Nov 3 18:14:09 2014 -0800
Committer: Jinfeng Ni <jni@maprtech.com>
Committed: Fri Nov 7 11:36:08 2014 -0800

----------------------------------------------------------------------
 .../src/main/codegen/templates/VariableLengthVectors.java       | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a8fd9758/exec/java-exec/src/main/codegen/templates/VariableLengthVectors.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/codegen/templates/VariableLengthVectors.java b/exec/java-exec/src/main/codegen/templates/VariableLengthVectors.java
index e1a754e..5338a71 100644
--- a/exec/java-exec/src/main/codegen/templates/VariableLengthVectors.java
+++ b/exec/java-exec/src/main/codegen/templates/VariableLengthVectors.java
@@ -451,6 +451,11 @@ public final class ${minor.class}Vector extends BaseDataValueVector implements
V
     }
 
     public boolean setValueLengthSafe(int index, int length) {
+      int offset = offsetVector.getAccessor().get(index);
+      if(data.capacity() < offset + length ) {
+        decrementAllocationMonitor();
+        return false;
+      }
       return offsetVector.getMutator().setSafe(index + 1, offsetVector.getAccessor().get(index)
+ length);
     }
 


Mime
View raw message