alamb commented on issue #5508: URL: https://github.com/apache/arrow-rs/issues/5508#issuecomment-2088296642
> As we know, we can use ViewArray for random access of byte buffers. So, when converting ViewArray to ByteArray, memory copy is unavoidable. I can't come up with a zero-copy way. > If I implement this operation, I will allocate brand new buffers for the target ByteArray. I want to discuss if there is a better way? I agree there is unlikely to be a zero copy way. The only potential exception I can imagine is if the underlying buffer was already pre-packed (though this would require all strings to be longer than 12 bytes and in order and contiguous). I suspect the time necessary to detect if this was the case would be substantial Thus I suggest we start with the simple case (copy to new buffer) and we can optimize later of it turns out that is an important usecase. I think some part of #5513 might be relevant here (namely the operation to compact the strings) 🤔 -- 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]
