alamb commented on code in PR #9075:
URL: https://github.com/apache/arrow-datafusion/pull/9075#discussion_r1473574213


##########
datafusion/core/src/execution/context/mod.rs:
##########
@@ -823,15 +823,7 @@ impl SessionContext {
     /// Any functions registered with the udf name or its aliases will be 
overwritten with this new function
     pub fn register_udf(&self, f: ScalarUDF) {
         let mut state = self.state.write();
-        let aliases = f.aliases();
-        for alias in aliases {
-            state
-                .scalar_functions
-                .insert(alias.to_string(), Arc::new(f.clone()));
-        }
-        state
-            .scalar_functions
-            .insert(f.name().to_string(), Arc::new(f));
+        state.register_udf(Arc::new(f)).ok();

Review Comment:
   moved into SessionState -- it is important that the alias resolution is done 
there so when new functions are registered via `SessionState` their aliases are 
as well. Otherwise aliases are only added when the function is defined via 
`SessionContext`



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

Reply via email to