viirya commented on code in PR #3276:
URL: https://github.com/apache/arrow-rs/pull/3276#discussion_r1042612681


##########
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 this is correct. This is not imported from ffi so the buffer follows 
arrow allocation rule.



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