'Unknown type: NULL' when initialising a NullableStructWriter from a struct with NullVector children
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
Research direction
Start with TestStructVector.testStructVectorTransferPairWithNullType and compare it with testStructVectorTransferPairWithExtensionType. Trace StructVector.getTransferPair into StructVector.java and NullableStructWriter.java, then run the focused TestStructVector tests; done when a struct containing a NullVector transfers without the Unknown type: NULL exception and the regression test passes.
Written by the indexing model from the issue text.
Description
Describe the bug, including details regarding any error messages, version, and platform.
added test case to TestStructVector:
@Test
public void testStructVectorTransferPairWithNullType() {
Field uuidField = new Field("null", FieldType.nullable(ArrowType.Null.INSTANCE), null);
Field structField =
new Field("struct", FieldType.nullable(new ArrowType.Struct()), List.of(uuidField));
try(StructVector s1 = (StructVector) structField.createVector(allocator)) {
NullVector nullVector =
s1.addOrGet("null", FieldType.nullable(ArrowType.Null.INSTANCE), NullVector.class);
s1.setValueCount(1);
nullVector.setNull(0);
s1.setIndexDefined(0);
TransferPair tp = s1.getTransferPair(structField, allocator);
try (StructVector toVector = (StructVector) tp.getTo()) {
assertEquals(s1.getField(), toVector.getField());
}
}
}
got this:
java.lang.UnsupportedOperationException: Unknown type: NULL
at org.apache.arrow.vector.complex.impl.NullableStructWriter.<init>(NullableStructWriter.java:279)
at org.apache.arrow.vector.complex.StructVector.<init>(StructVector.java:74)
at org.apache.arrow.vector.complex.StructVector.getTransferPair(StructVector.java:261)
at org.apache.arrow.vector.TestStructVector.testStructVectorTransferPairWithNullType(TestStructVector.java:389)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
expected: similar result to testStructVectorTransferPairWithExtensionType
Cheers!
James
our issue: xtdb/xtdb#4693
- Dominant language
- Java
- Stars
- 95
- Forks
- 154
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/arrow-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
apache/arrow-java#1261 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/arrow-java#1236 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/arrow-java#1230 ·
-
Type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
apache/arrow-java#1205 ·
-
Type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/arrow-java#1196 · 1 comment ·
All issues in apache/arrow-java
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/eo-graphs#74 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100