From c2bdcf37ad94ce71fc35e22639b0b89e042cb276 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Fri, 8 Aug 2025 08:09:31 +0200 Subject: [PATCH] Link UdfEq and PtrEq to help understand relationship. --- datafusion/expr/src/ptr_eq.rs | 2 ++ datafusion/expr/src/udf_eq.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/datafusion/expr/src/ptr_eq.rs b/datafusion/expr/src/ptr_eq.rs index c85b3d9950cd9..0bbfba5e8d063 100644 --- a/datafusion/expr/src/ptr_eq.rs +++ b/datafusion/expr/src/ptr_eq.rs @@ -36,6 +36,8 @@ pub fn arc_ptr_hash(a: &Arc, hasher: &mut impl Hasher) { /// A wrapper around a pointer that implements `Eq` and `Hash` comparing /// the underlying pointer address. +/// +/// If you have pointers to a `dyn UDF impl` consider using [`super::udf_eq::UdfEq`]. #[derive(Clone)] #[allow(private_bounds)] // This is so that PtrEq can only be used with allowed pointer types (e.g. Arc), without allowing misuse. pub struct PtrEq(Ptr); diff --git a/datafusion/expr/src/udf_eq.rs b/datafusion/expr/src/udf_eq.rs index 1871aab3fd932..75d6a41c36e6b 100644 --- a/datafusion/expr/src/udf_eq.rs +++ b/datafusion/expr/src/udf_eq.rs @@ -23,6 +23,8 @@ use std::sync::Arc; /// A wrapper around a pointer to UDF that implements `Eq` and `Hash` delegating to /// corresponding methods on the UDF trait. +/// +/// If you want to just compare pointers for equality, use [`super::ptr_eq::PtrEq`]. #[derive(Clone)] #[allow(private_bounds)] // This is so that UdfEq can only be used with allowed pointer types (e.g. Arc), without allowing misuse. pub struct UdfEq(Ptr);