comphead commented on code in PR #13712:
URL: https://github.com/apache/datafusion/pull/13712#discussion_r1879083970
##########
datafusion/functions/src/macros.rs:
##########
@@ -65,24 +65,23 @@ macro_rules! export_functions {
};
}
-/// Creates a singleton `ScalarUDF` of the `$UDF` function named `$GNAME` and a
-/// function named `$NAME` which returns that singleton.
+/// Creates a singleton `ScalarUDF` of the `$UDF` function and a function
+/// named `$NAME` which returns that singleton.
///
/// This is used to ensure creating the list of `ScalarUDF` only happens once.
macro_rules! make_udf_function {
- ($UDF:ty, $GNAME:ident, $NAME:ident) => {
- #[doc = "Return a [`ScalarUDF`](datafusion_expr::ScalarUDF)
implementation "]
- #[doc = stringify!($UDF)]
+ ($UDF:ty, $NAME:ident) => {
+ #[doc = concat!("Return a [`ScalarUDF`](datafusion_expr::ScalarUDF)
implementation of ", stringify!($NAME))]
pub fn $NAME() -> std::sync::Arc<datafusion_expr::ScalarUDF> {
// Singleton instance of the function
- static $GNAME: std::sync::LazyLock<
+ static INSTANCE: std::sync::LazyLock<
Review Comment:
here we go where lazy lock shines
--
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]