Skip to content

Commit 4924e51

Browse files
committed
Address comments
Signed-off-by: Robert Kruszewski <github@robertk.io>
1 parent d897b91 commit 4924e51

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

c/src/main/java/org/apache/arrow/c/ArrayImporter.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ final class ArrayImporter {
5353
void importArray(ArrowArray src) {
5454
ArrowArray.Snapshot snapshot = src.snapshot();
5555
checkState(snapshot.release != NULL, "Cannot import released ArrowArray");
56-
checkState(
57-
snapshot.offset == 0,
58-
"ArrowArray struct has non-zero offset (%s), which is not supported",
59-
snapshot.offset);
6056

6157
// Move imported array
6258
ArrowArray ownedArray = ArrowArray.allocateNew(allocator);
@@ -87,6 +83,11 @@ private void importChild(ArrayImporter parent, ArrowArray src) {
8783
}
8884

8985
private void doImport(ArrowArray.Snapshot snapshot) {
86+
checkState(
87+
snapshot.offset == 0 || snapshot.length == 0,
88+
"ArrowArray struct has non-zero offset (%s), which is not supported",
89+
snapshot.offset);
90+
9091
// First import children (required for reconstituting parent array data)
9192
long[] children =
9293
NativeUtil.toJavaArray(snapshot.children, checkedCastToInt(snapshot.n_children));

0 commit comments

Comments
 (0)