viirya commented on code in PR #967:
URL: https://github.com/apache/arrow-java/pull/967#discussion_r2714545942


##########
vector/src/test/java/org/apache/arrow/vector/TestLargeListVector.java:
##########
@@ -1100,6 +1100,36 @@ public void testCopyValueSafeForExtensionType() throws 
Exception {
     }
   }
 
+  @Test
+  public void testNestedEmptyLargeListOffsetBuffer() {
+    // Test that nested LargeListVector properly allocates offset buffer
+    // even when nested writers are never invoked. According to Arrow spec,
+    // offset buffer must have N+1 entries. Even when N=0, it should contain 
[0].
+    try (LargeListVector outerList = LargeListVector.empty("outer", 
allocator)) {
+      // Setup LargeList<LargeList<Int>>
+      
outerList.addOrGetVector(FieldType.nullable(MinorType.LARGELIST.getType()));
+      LargeListVector innerList = (LargeListVector) outerList.getDataVector();
+      innerList.addOrGetVector(FieldType.nullable(MinorType.INT.getType()));
+
+      // Allocate outer only - simulates case where inner is never written to
+      outerList.allocateNew();
+      outerList.setValueCount(0);

Review Comment:
   I think `innerList` should also call `allocateNew`? Not allocated is 
different to not written.



-- 
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