arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject arrow git commit: ARROW-402: Fix reference counting issue with empty buffers. Close #232
Date Fri, 09 Dec 2016 18:35:37 GMT
Repository: arrow
Updated Branches:
  refs/heads/master 14ed1be2d -> 8995c9230


ARROW-402: Fix reference counting issue with empty buffers. Close #232

Change-Id: I87910c03d7ebca5a8edbf53d01f70c38ef339f04


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/8995c923
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/8995c923
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/8995c923

Branch: refs/heads/master
Commit: 8995c923043788f98afef4dd80f72de4688a8e0c
Parents: 14ed1be
Author: Julien Le Dem <julien@dremio.com>
Authored: Thu Dec 8 21:24:29 2016 -0800
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Fri Dec 9 13:34:59 2016 -0500

----------------------------------------------------------------------
 java/vector/src/main/java/org/apache/arrow/vector/BitVector.java  | 1 -
 .../test/java/org/apache/arrow/vector/TestVectorUnloadLoad.java   | 3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/8995c923/java/vector/src/main/java/org/apache/arrow/vector/BitVector.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/BitVector.java b/java/vector/src/main/java/org/apache/arrow/vector/BitVector.java
index 48da8e7..26eeafd 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/BitVector.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/BitVector.java
@@ -53,7 +53,6 @@ public final class BitVector extends BaseDataValueVector implements FixedWidthVe
   public void load(ArrowFieldNode fieldNode, ArrowBuf data) {
     // When the vector is all nulls or all defined, the content of the buffer can be omitted
     if (data.readableBytes() == 0 && fieldNode.getLength() != 0) {
-      data.release();
       int count = fieldNode.getLength();
       allocateNew(count);
       int n = getSizeFromCount(count);

http://git-wip-us.apache.org/repos/asf/arrow/blob/8995c923/java/vector/src/test/java/org/apache/arrow/vector/TestVectorUnloadLoad.java
----------------------------------------------------------------------
diff --git a/java/vector/src/test/java/org/apache/arrow/vector/TestVectorUnloadLoad.java b/java/vector/src/test/java/org/apache/arrow/vector/TestVectorUnloadLoad.java
index 7a70ffd..79c9d50 100644
--- a/java/vector/src/test/java/org/apache/arrow/vector/TestVectorUnloadLoad.java
+++ b/java/vector/src/test/java/org/apache/arrow/vector/TestVectorUnloadLoad.java
@@ -187,7 +187,7 @@ public class TestVectorUnloadLoad {
         new Field("intNull", true, new ArrowType.Int(32, true), Collections.<Field>emptyList())
         ));
     int count = 10;
-    ArrowBuf validity = allocator.getEmpty();
+    ArrowBuf validity = allocator.buffer(10).slice(0, 0);
     ArrowBuf[] values = new ArrowBuf[2];
     for (int i = 0; i < values.length; i++) {
       ArrowBuf arrowBuf = allocator.buffer(count * 4); // integers
@@ -236,6 +236,7 @@ public class TestVectorUnloadLoad {
       for (ArrowBuf arrowBuf : values) {
         arrowBuf.release();
       }
+      validity.release();
     }
   }
 


Mime
View raw message