alamb commented on code in PR #13290:
URL: https://github.com/apache/datafusion/pull/13290#discussion_r1852479246
##########
datafusion/expr/src/udf.rs:
##########
@@ -324,6 +327,16 @@ where
}
}
+pub struct ScalarFunctionArgs<'a> {
Review Comment:
Yes, I was thinking something like
```rust
trait ScalarUDFImpl {
/// prepares to run the function, returning any state (such as
/// a precompiled regex). Called once per instance of function in the query
fn prepare(&self, args: &ScalarFunctionArgs) -> Option<Box<dyn Any>> {
None }
/// `prepared` field in ScalarFunctonArgs has the result of calling
`prepare`
fn invoke_with_args(&self, args: &ScalarFunctionArgs) -> ...
```
```rust
pub struct ScalarFunctionArgs<'a> {
...
/// The result from a call to `prepare` for this function instance
prepared: Option<Box<dyn Any>>,
}
```
--
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]