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


##########
java/vector/src/main/java/org/apache/arrow/vector/ipc/JsonFileWriter.java:
##########
@@ -277,6 +281,14 @@ private void writeFromVectorIntoJson(Field field, 
FieldVector vector) throws IOE
               vectorBufferTmp.setLong(0, 0);
               writeValueToGenerator(bufferType, vectorBufferTmp, null, vector, 
i);
             }
+          } else if (bufferType.equals(SIZE)
+              && vector.getValueCount() == 0
+              && vector.getMinorType() == MinorType.LISTVIEW) {
+            // Empty vectors may not have allocated a sizes buffer
+            try (ArrowBuf vectorBufferTmp = vector.getAllocator().buffer(4)) {
+              vectorBufferTmp.setInt(0, 0);
+              writeValueToGenerator(bufferType, vectorBufferTmp, null, vector, 
i);
+            }

Review Comment:
   Need to test this. 



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to