shehabgamin commented on code in PR #17220:
URL: https://github.com/apache/datafusion/pull/17220#discussion_r2567230094
##########
datafusion/expr/src/udf.rs:
##########
@@ -714,6 +774,58 @@ pub trait ScalarUDFImpl: Debug + DynEq + DynHash + Send +
Sync {
fn documentation(&self) -> Option<&Documentation> {
None
}
+
+ /// Attempts to optimize or transform the function call.
+ ///
+ /// This method allows UDF implementations to provide optimized versions
+ /// of function calls or transform them into different expressions.
+ /// Returns `None` if no optimization is available.
+ ///
+ /// # Arguments
+ /// * `_args` - The function arguments to potentially optimize
+ ///
+ /// # Returns
+ /// An optional optimized expression, or None if no optimization is
available
+ fn try_call(&self, _args: &[Expr]) -> Result<Option<Expr>> {
Review Comment:
Nitpick: Agreed, more descriptive name would be nice
--
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]