From 17fb5520e8c4da71f2fa655342ddf3f6b837b526 Mon Sep 17 00:00:00 2001 From: Vibhatha Abeykoon Date: Mon, 12 Aug 2024 07:54:39 +0530 Subject: [PATCH] feat: adding more test cases --- .../arrow/vector/TestSplitAndTransfer.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/java/vector/src/test/java/org/apache/arrow/vector/TestSplitAndTransfer.java b/java/vector/src/test/java/org/apache/arrow/vector/TestSplitAndTransfer.java index d20dc3348b1c9..a3f25bc5207b6 100644 --- a/java/vector/src/test/java/org/apache/arrow/vector/TestSplitAndTransfer.java +++ b/java/vector/src/test/java/org/apache/arrow/vector/TestSplitAndTransfer.java @@ -29,6 +29,7 @@ import org.apache.arrow.memory.RootAllocator; import org.apache.arrow.vector.complex.DenseUnionVector; import org.apache.arrow.vector.complex.FixedSizeListVector; +import org.apache.arrow.vector.complex.LargeListViewVector; import org.apache.arrow.vector.complex.ListVector; import org.apache.arrow.vector.complex.MapVector; import org.apache.arrow.vector.complex.StructVector; @@ -852,6 +853,25 @@ public void testListVectorZeroStartIndexAndLength() { } } + @Test + public void testLargeListViewVectorZeroStartIndexAndLength() { + try (final LargeListViewVector listVector = + LargeListViewVector.empty("largelistview", allocator); + final LargeListViewVector newListVector = LargeListViewVector.empty("newList", allocator)) { + + listVector.allocateNew(); + final int valueCount = 0; + listVector.setValueCount(valueCount); + + final TransferPair tp = listVector.makeTransferPair(newListVector); + + tp.splitAndTransfer(0, 0); + assertEquals(valueCount, newListVector.getValueCount()); + + newListVector.clear(); + } + } + @Test public void testStructVectorZeroStartIndexAndLength() { Map metadata = new HashMap<>();