alamb commented on code in PR #17078:
URL: https://github.com/apache/datafusion/pull/17078#discussion_r2263312644


##########
datafusion/physical-expr/src/scalar_function.rs:
##########
@@ -175,42 +173,47 @@ impl fmt::Display for ScalarFunctionExpr {
     }
 }
 
-impl DynEq for ScalarFunctionExpr {
-    fn dyn_eq(&self, other: &dyn Any) -> bool {
-        other.downcast_ref::<Self>().is_some_and(|o| {
-            self.fun.eq(&o.fun)
-                && self.name.eq(&o.name)
-                && self.args.eq(&o.args)
-                && self.return_field.eq(&o.return_field)
-                && self
-                    .config_options
-                    .entries()
-                    .iter()
-                    .sorted_by(|&l, &r| l.key.cmp(&r.key))
-                    .zip(
-                        o.config_options
-                            .entries()
-                            .iter()
-                            .sorted_by(|&l, &r| l.key.cmp(&r.key)),
-                    )
-                    .filter(|(l, r)| l.ne(r))
-                    .count()
-                    == 0
-        })
+impl PartialEq for ScalarFunctionExpr {
+    fn eq(&self, o: &Self) -> bool {
+        let Self {
+            fun,
+            name,
+            args,
+            return_field,
+            config_options,
+        } = self;
+        fun.eq(&o.fun)
+            && name.eq(&o.name)
+            && args.eq(&o.args)
+            && return_field.eq(&o.return_field)
+            && sorted_config_entries(config_options)

Review Comment:
   For the making the hash faster as well, I propose ignore the 
`config_options` field in Hash (but still check in PartialEq), as explained 
here:
   
   https://github.com/apache/datafusion/pull/16970#discussion_r2263308403
   
   > That would be a change in eq semantics, so let's run it as a separate PR.
   
   I don't undestand this statement (what semantics would be changing)?



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