alamb commented on code in PR #16781: URL: https://github.com/apache/datafusion/pull/16781#discussion_r2208644548
########## datafusion/doc/src/lib.rs: ########## @@ -158,7 +158,7 @@ impl Documentation { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Hash)] Review Comment: 👍 ########## datafusion/core/tests/user_defined/user_defined_scalar_functions.rs: ########## @@ -217,6 +217,34 @@ impl ScalarUDFImpl for Simple0ArgsScalarUDF { fn invoke_with_args(&self, _args: ScalarFunctionArgs) -> Result<ColumnarValue> { Ok(ColumnarValue::Scalar(ScalarValue::Int32(Some(100)))) } + + fn equals(&self, other: &dyn ScalarUDFImpl) -> bool { + let Some(other) = other.as_any().downcast_ref::<Self>() else { + return false; + }; + let Self { Review Comment: I do like the pattern in this PR to use explicit destructing so the compiler ensures the fields are all used ########## datafusion/functions-nested/src/sort.rs: ########## @@ -157,6 +158,23 @@ impl ScalarUDFImpl for ArraySort { fn documentation(&self) -> Option<&Documentation> { self.doc() } + + fn equals(&self, other: &dyn ScalarUDFImpl) -> bool { Review Comment: given how many of these functions only use signature and aliases, perhaps we could add `aliases` to the default implementation and save a bunch of extra boilerplate -- 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