gatesn commented on issue #6727: URL: https://github.com/apache/arrow-rs/issues/6727#issuecomment-2506579558
> > The other possibly reasonable fix is that the null take indices should turn the StructArray's null buffer, rather than the null buffers of each of the fields. > > The issue I see with this approach is that managing nulls at the StructArray's null buffer, but not in the null buffers of each of the fields, can lead to uninitialized or default values in those fields. So, if someone tries to access those values using `column_by_name` without checking the StructArray's null bitmap, they could encounter unexpected behavior, right? That's correct. But that's also true if I access a PrimitiveArray value buffer and don't check the null bitmap. I think I've come round to agreeing with @tustvold, although it is a little odd, that a non-nullable field can contain nulls provided they are masked by the struct array's own validity bitmap. If a row is invalid in the struct array, then all bets are off when looking at that index in one of the struct's fields. As such, I'm going to close this. Happy for someone else to re-open if they disagree with this conclusion -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
