Skip to content

Commit 520040f

Browse files
robert3005jbonofre
authored andcommitted
test
1 parent 8c7fd35 commit 520040f

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

c/src/test/java/org/apache/arrow/c/RoundtripTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,24 @@ public void testImportArrayWithNonZeroOffset() {
10721072
}
10731073
}
10741074

1075+
@Test
1076+
public void testImportEmptyArrayWithNonZeroOffset() {
1077+
try (IntVector source = new IntVector("source", allocator);
1078+
IntVector destination = new IntVector("destination", allocator);
1079+
ArrowArray array = ArrowArray.allocateNew(allocator)) {
1080+
setVector(source, 1, 2, 3);
1081+
Data.exportVector(allocator, source, null, array);
1082+
1083+
ArrowArray.Snapshot snapshot = array.snapshot();
1084+
snapshot.offset = source.getValueCount();
1085+
snapshot.length = 0;
1086+
array.save(snapshot);
1087+
1088+
Data.importIntoVector(allocator, array, destination, null);
1089+
assertEquals(0, destination.getValueCount());
1090+
}
1091+
}
1092+
10751093
@Test
10761094
public void testArrayStructReuse() {
10771095
// Consumer allocates empty structures

0 commit comments

Comments
 (0)