vibhatha commented on code in PR #41967:
URL: https://github.com/apache/arrow/pull/41967#discussion_r1628977945


##########
java/vector/src/main/java/org/apache/arrow/vector/BaseVariableWidthViewVector.java:
##########
@@ -1667,4 +1667,23 @@ protected void getData(int index, ReusableBuffer<?> 
buffer) {
   public <OUT, IN> OUT accept(VectorVisitor<OUT, IN> visitor, IN value) {
     return visitor.visit(this, value);
   }
+
+  @Override
+  public void exportCDataBuffers(List<ArrowBuf> buffers, ArrowBuf buffersPtr, 
long nullValue) {
+    exportBuffer(validityBuffer, buffers, buffersPtr, nullValue, true);
+
+    if (viewBuffer.capacity() == 0) {
+      // Empty view buffer is allowed here.
+      // We set `retain = false` to explicitly not increase the ref count for 
the exported buffer.
+      // The ref count of the newly created buffer (i.e., 1) already 
represents the usage
+      // of the imported side.
+      exportBuffer(allocator.buffer(INITIAL_BYTE_COUNT), buffers, buffersPtr, 
nullValue, false);

Review Comment:
   @lidavidm should we do this in a better way? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to