jorgecarleitao commented on pull request #8560: URL: https://github.com/apache/arrow/pull/8560#issuecomment-721527129
> I think we have a similar problem with building arrays from `ArrayDataBuilder` because when building `ArrayData`, we don't check if the length of the array corresponds with the buffer's length (or if it's even specified). > > So something like the below gets created, but ends up as a 0-len array > > ```rust > // try build array data without specifying length > ArrayData::builder(DataType::_).buffers(vec![buffer1, buffer2]).build() > ``` That is a very good point. I think that we have a trade-off here: do we check that the `ArrayData` is according to spec (and incur the testing cost), or do we not check and live with potential UB? We can have APIs for a safe and unsafe, but we still need to decide what is public and what is not :P This could be a good topic for the mailing list, as it is a general question, specially for IPC and the c data interface. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
