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


##########
vector/src/test/java/org/apache/arrow/vector/TestLargeListVector.java:
##########
@@ -1100,6 +1100,38 @@ 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()));

Review Comment:
   I looked these tests again. I think this nested structure is not necessary 
for the unit tests here. It only matter for our usage at Spark side (on the 
ArrowWriters). But for here, we just need to make sure that a 
ListVector/LargeListVector has meaningful and correct `readableBytes` value 
after they are allocated.
   
   Maybe we can simplify these tests.



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