alamb commented on issue #8051:
URL: https://github.com/apache/datafusion/issues/8051#issuecomment-2491721633

   Copying a comment from https://github.com/apache/datafusion/pull/13290
   
   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: 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