Omega359 commented on issue #17993:
URL: https://github.com/apache/datafusion/issues/17993#issuecomment-3391873248

   I've been poking at this for a while and I don't see an easy way to make 
this work. Wiring 
[ConfigOptions](https://github.com/apache/datafusion/blob/980c948d8a6343d061058afd1596ece29ea25a83/datafusion/common/src/config.rs#L981)
 into the 
[return_field_from_args](https://github.com/apache/datafusion/blob/1961fe79c19da5bd07e59a409d392328caa4d28e/datafusion/functions/src/datetime/now.rs#L80)
 function touches far, far too many things for it to be worth it.
   
   
   My best thought for making this work is to clone the ScalarUDF whenever it's 
needed 
([here](https://github.com/apache/datafusion/blob/28fba58a64da6437e22cb569b833aaa387f17ccf/datafusion/sql/src/expr/function.rs#L583)
 for example) to make the function stateful and then call a new function say 
`initialize(config_options: Arc<ConfigOptions>)` which would then provide the 
function with any required state it required.
   
   Without something like the above functions like now that do not have a 
return type that is determined by the args provided but rather determined 
externally or via configuration just can't work properly.


-- 
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]

Reply via email to