Omega359 commented on PR #11400:
URL: https://github.com/apache/datafusion/pull/11400#issuecomment-2221586240
> Can you remind me why you need the physical expr to have access to configs
at runtime rather than having the planner pass the relevant configs into the
expressions when they are created?
It's the singleton nature of UDF's currently - there isn't a way to
configure them at all. You can replace a udf in the FunctionFactory with one
with a different config which works well for sql however if you want to use the
dataframe api with the standard function names such a `to_timestamp(args)` vs
manually calling a modified function via something like
`ctx.udf("to_timestamp").unwrap().call(args)` you can't as you cannot replace
or modify what that function calls as it's a singleton
```
static $GNAME:
std::sync::OnceLock<std::sync::Arc<datafusion_expr::ScalarUDF>> =
std::sync::OnceLock::new();
```
If there was a way to configure those (via argument to invoke, etc) or
replace the singletons with a pre-configured instance (or better yet,
referencing the one in the FunctionFactory) that would solve the issue.
--
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]