jayzhan211 commented on code in PR #9980:
URL: https://github.com/apache/arrow-datafusion/pull/9980#discussion_r1554812821
##########
datafusion/functions-array/src/lib.rs:
##########
@@ -98,54 +103,245 @@ pub mod expr_fn {
pub use super::string::string_to_array;
}
+
+
+pub type ScalarFactory = Box<dyn Fn() -> Arc<ScalarUDF> + Send + Sync>;
+
+/// HashMap Singleton for UDFs
+///
+/// Replace register_all with our built-in functions
+/// Replace scalar_functions: HashMap<String, Arc<ScalarUDF>> in SessionState
+pub fn array_functions() -> &'static Mutex<HashMap<String, ScalarFactory>> {
+ static FUNCTIONS: OnceLock<Mutex<HashMap<String, ScalarFactory>>> =
OnceLock::new();
+ FUNCTIONS.get_or_init(|| {
+ let mut functions = HashMap::new();
+ functions.insert(
+ String::from("array_to_string"),
Review Comment:
With alias support, this commit can run.
I think we need to public aliases function 🤔
--
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]