zeroshade commented on issue #76:
URL: https://github.com/apache/arrow-nanoarrow/issues/76#issuecomment-1330973207

   @lidavidm I believe the reason why the Go library assumes that the data 
buffer is not nil is because of the way I read the specification in the 
documentation 
[here](https://arrow.apache.org/docs/format/CDataInterface.html#c.ArrowArray.buffers)
 which said buffers were mandatory and only specifies that the validity buffer 
*may* be null if null count is 0. Which, admittedly, says nothing about whether 
or not the data buffer is allowed to be null. 
   
   > since `malloc(0)` may return NULL and it would be a little weird to say 
that we're forced to allocate.
   
   I agree with this and that I should fix this in the Go implementation. At a 
minimum, it shouldn't crash I'll make a GH issue for this. I agree with @pitrou 
we should clarify in the spec, and my vote is that the spec should specifically 
state it is allowed for the data buffer to be nil if the length is 0.


-- 
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]

Reply via email to