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


##########
datafusion/ffi/src/udaf/mod.rs:
##########
@@ -384,6 +385,19 @@ pub struct ForeignAggregateUDF {
 unsafe impl Send for ForeignAggregateUDF {}
 unsafe impl Sync for ForeignAggregateUDF {}
 
+impl PartialEq for ForeignAggregateUDF {
+    fn eq(&self, other: &Self) -> bool {
+        // FFI_AggregateUDF cannot be compared, so identity equality is the 
best we can do.
+        std::ptr::eq(self, other)
+    }
+}
+impl Eq for ForeignAggregateUDF {}
+impl Hash for ForeignAggregateUDF {
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        std::ptr::hash(self, state)
+    }
+}
+

Review Comment:
   I think this is okay to merge in, but I wonder if it would be better to add 
a hash function to the FFI and call it on the other side.



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

Reply via email to