You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "jarohen (via GitHub)" <gi...@apache.org> on 2024/04/04 08:57:54 UTC
[I] [Java] AIOOBE trying to splitAndTransfer DUV within nullable struct [arrow]
jarohen opened a new issue, #40999:
URL: https://github.com/apache/arrow/issues/40999
### Describe the bug, including details regarding any error messages, version, and platform.
If a `DenseUnionVector` is contained within a nullable `StructVector`, and that struct has nullable entries, trying to `splitAndTransfer` fails with an `ArrayIndexOutOfBoundsException`.
Within a struct vector, if an entry is null, then the entries in its children vectors are undefined, so DUV cannot always expect `typeId >= 0`, and should guard against it where necessary.
Test case:
```java
@Test
public void testSplitAndTransferDuvInStruct() {
try (StructVector struct = StructVector.empty("struct", allocator)) {
DenseUnionVector duv = struct.addOrGet("duv",
FieldType.notNullable(MinorType.DENSEUNION.getType()),
DenseUnionVector.class);
byte i32TypeId = duv.registerNewTypeId(Field.notNullable("i32", MinorType.INT.getType()));
duv.addVector(i32TypeId, new IntVector("i32", allocator));
struct.setIndexDefined(0);
duv.setTypeId(0, i32TypeId);
duv.setSafe(0, newIntHolder(42));
struct.setNull(1);
struct.setValueCount(2);
try (StructVector dest = StructVector.empty("dest", allocator)) {
TransferPair pair = struct.makeTransferPair(dest);
pair.splitAndTransfer(0, 2);
assertEquals(2, dest.getValueCount());
assertFalse(dest.isNull(0));
assertEquals(42, dest.getObject(0).get("duv"));
assertTrue(dest.isNull(1));
}
}
}
```
(PR incoming)
### Component(s)
Java
--
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: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Java] AIOOBE trying to splitAndTransfer DUV within nullable struct [arrow]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm closed issue #40999: [Java] AIOOBE trying to splitAndTransfer DUV within nullable struct
URL: https://github.com/apache/arrow/issues/40999
--
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: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Java] AIOOBE trying to splitAndTransfer DUV within nullable struct [arrow]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #40999:
URL: https://github.com/apache/arrow/issues/40999#issuecomment-2041685703
Issue resolved by pull request 41000
https://github.com/apache/arrow/pull/41000
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org