viirya commented on code in PR #905: URL: https://github.com/apache/datafusion-comet/pull/905#discussion_r1744475477
########## native/core/src/execution/utils.rs: ########## @@ -96,6 +99,22 @@ impl SparkArrowConvert for ArrayData { Ok((array as i64, schema as i64)) } + + /// Move this ArrowData to pointers of Arrow C data interface. + fn move_to_spark(&self, array: i64, schema: i64) -> Result<(), ExecutionError> { + let jvm_array = unsafe { std::ptr::replace(array as *mut FFI_ArrowArray, FFI_ArrowArray::new(self)) }; + let jvm_schema = unsafe { + std::ptr::replace( + schema as *mut FFI_ArrowSchema, + FFI_ArrowSchema::try_from(self.data_type())?, + ) + }; + + std::mem::forget(jvm_array); + std::mem::forget(jvm_schema); Review Comment: Trying a fix. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org