TansferPair doesn't preserve nullability of children in struct vectors.
FiV0 opened this issue · comments
Finn Völkel commented
Only changing nullability of struct vector currently also results in the children potentially changing nullability
@Test
fun `test non nullability preserved in children` () {
val intField = Field("int", FieldType.notNullable(MinorType.BIGINT.type), emptyList())
val structField = Field("my-struct", FieldType.notNullable(STRUCT_TYPE), listOf(intField))
val vector = structField.createVector(al)
val newVector = vector
.getTransferPair(Field(structField.name, FieldType.nullable(structField.type), structField.children), al)
.also { it.transfer() }
.to as FieldVector
// passes
assertEquals(structField.children[0], intField)
// fails
assertEquals(newVector.field.children[0], intField)
}
Finn Völkel commented
Raised upstream apache/arrow#41686
Finn Völkel commented
Fixed upstream apache/arrow#41785