timsaucer commented on code in PR #18672:
URL: https://github.com/apache/datafusion/pull/18672#discussion_r2556683404


##########
datafusion/ffi/src/udaf/groups_accumulator.rs:
##########
@@ -260,9 +268,19 @@ pub struct ForeignGroupsAccumulator {
 unsafe impl Send for ForeignGroupsAccumulator {}
 unsafe impl Sync for ForeignGroupsAccumulator {}
 
-impl From<FFI_GroupsAccumulator> for ForeignGroupsAccumulator {
-    fn from(accumulator: FFI_GroupsAccumulator) -> Self {
-        Self { accumulator }
+impl From<FFI_GroupsAccumulator> for Box<dyn GroupsAccumulator> {
+    fn from(mut accumulator: FFI_GroupsAccumulator) -> Self {
+        if (accumulator.library_marker_id)() == crate::get_library_marker_id() 
{
+            unsafe {
+                let private_data = Box::from_raw(
+                    accumulator.private_data as *mut 
GroupsAccumulatorPrivateData,
+                );
+                accumulator.private_data = null_mut();

Review Comment:
   Added for consistency and in partition evaluator



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to