alamb commented on code in PR #8360:
URL: https://github.com/apache/arrow-datafusion/pull/8360#discussion_r1411322671
##########
datafusion/core/src/execution/context/mod.rs:
##########
@@ -811,8 +811,14 @@ impl SessionContext {
/// - `SELECT MY_FUNC(x)...` will look for a function named `"my_func"`
/// - `SELECT "my_FUNC"(x)` will look for a function named `"my_FUNC"`
pub fn register_udf(&self, f: ScalarUDF) {
- self.state
- .write()
+ 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()));
Review Comment:
comments added ✅
##########
datafusion/core/src/execution/context/mod.rs:
##########
@@ -811,8 +811,14 @@ impl SessionContext {
/// - `SELECT MY_FUNC(x)...` will look for a function named `"my_func"`
/// - `SELECT "my_FUNC"(x)` will look for a function named `"my_FUNC"`
pub fn register_udf(&self, f: ScalarUDF) {
- self.state
- .write()
+ 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()));
Review Comment:
comments added ✅
--
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]