'Unknown type: NULL' when initialising a NullableStructWriter from a struct with NullVector children
- Linguagem predominante
- Java
- Estrelas
- 94
- Forks
- 152
- Merge médio
- 3d 16h
- PRs com merge (30d)
- 11
Descrição
### Describe the bug, including details regarding any error messages, version, and platform.
added test case to TestStructVector:
```java
@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.(NullableStructWriter.java:279)
at org.apache.arrow.vector.complex.StructVector.(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
Guia de contribuição
Direção de pesquisa
Comece com TestStructVector.testStructVectorTransferPairWithNullType e compare-o com testStructVectorTransferPairWithExtensionType. Rastreie StructVector.getTransferPair até StructVector.java e NullableStructWriter.java e, em seguida, execute os testes focados de TestStructVector; concluído quando uma struct contendo um NullVector for transferida sem a exceção Unknown type: NULL e o teste de regressão passar.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- java
- Domínio
- data
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 58/100