wangfenjin commented on a change in pull request #1449:
URL: https://github.com/apache/arrow-rs/pull/1449#discussion_r827656339



##########
File path: arrow/src/ffi.rs
##########
@@ -781,11 +781,19 @@ impl ArrowArray {
                     .to_string(),
             ));
         };
-        let ffi_array = (*array).clone();
-        let ffi_schema = (*schema).clone();
+
+        let array_mut = array as *mut FFI_ArrowArray;
+        let schema_mut = schema as *mut FFI_ArrowSchema;
+
+        let array_data = std::ptr::replace(array_mut, FFI_ArrowArray::empty());

Review comment:
       > However this can only be done after the exported array is imported via 
FFI_ArrowArray::try_from_raw, which we don't know when.
   
   1. It may not be imported in rust via FFI_ArrowArray::try_from_raw, it can 
be imported by other language sdk
   2. We don't need to know, the user should import it somewhere or free them 
if needed, that's why we can't use Arc::into_raw because we don't know how user 
might use them. This API should be fired and done, shouldn't expect user always 
do something like try_from_raw




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