wjones127 commented on code in PR #3276:
URL: https://github.com/apache/arrow-rs/pull/3276#discussion_r1041280907
##########
arrow/src/ffi.rs:
##########
@@ -657,13 +657,14 @@ pub trait ArrowArrayRef {
let len = self.buffer_len(index)?;
- unsafe { create_buffer(self.owner().clone(), self.array(),
index, len) }
- .ok_or_else(|| {
- ArrowError::CDataInterface(format!(
- "The external buffer at position {} is null.",
- index - 1
- ))
- })
+ Ok(unsafe {
+ create_buffer(self.owner().clone(), self.array(), index,
len)
+ }
+ .unwrap_or_else(|| {
+ // Null data buffer, which Rust doesn't allow. So create
+ // an empty buffer.
+ MutableBuffer::new(0).into()
Review Comment:
I *think* the lifetime of this buffer should be handled by the underlying
Arc once it becomes a `Buffer`, but please correct me on that if I'm wrong.
--
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]