milenkovicm commented on PR #17650: URL: https://github.com/apache/datafusion/pull/17650#issuecomment-3315525865
Looking at the `FunctionRegisty` usage, if we ignore `proto` submodule, its not really used as parameter anywhere. and with #17596 question is to be asked do we need it at all ? also, two notable implementations, `SessionState` and `MemoryFunctionRegistry` both of them implement register functions differently `SessionState`: https://github.com/milenkovicm/datafusion/blob/2279ec6058e8e6a88d0a83360abb3d4b20b3c699/datafusion/core/src/execution/session_state.rs#L1829-L1839 ```rust fn register_udf( &mut self, udf: Arc<ScalarUDF>, ) -> datafusion_common::Result<Option<Arc<ScalarUDF>>> { udf.aliases().iter().for_each(|alias| { self.scalar_functions .insert(alias.clone(), Arc::clone(&udf)); }); Ok(self.scalar_functions.insert(udf.name().into(), udf)) } ``` `MemoryFunctionRegistry:` https://github.com/milenkovicm/datafusion/blob/2279ec6058e8e6a88d0a83360abb3d4b20b3c699/datafusion/expr/src/registry.rs#L203-L206 ```rust fn register_udf(&mut self, udf: Arc<ScalarUDF>) -> Result<Option<Arc<ScalarUDF>>> { Ok(self.udfs.insert(udf.name().to_string(), udf)) } ``` -- 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