jayzhan211 commented on code in PR #10700:
URL: https://github.com/apache/datafusion/pull/10700#discussion_r1618774900


##########
datafusion/functions/src/macros.rs:
##########
@@ -59,6 +59,30 @@ macro_rules! export_functions {
     };
 }
 
+macro_rules! make_function {
+    // single vector argument (a single argument followed by a comma)
+    ($FUNC:ident, $DOC:expr, $arg:ident,) => {
+        #[doc = $DOC]
+        pub fn $FUNC($arg: Vec<datafusion_expr::Expr>) -> 
datafusion_expr::Expr {
+            super::$FUNC().call($arg)
+        }
+    };
+    // variadic arguments (zero or more arguments, without commas)
+    ($FUNC:ident, $DOC:expr, $($arg:ident)*) => {
+        #[doc = $DOC]
+        pub fn $FUNC($($arg: datafusion_expr::Expr),*) -> 
datafusion_expr::Expr {
+            super::$FUNC().call(vec![$($arg),*])
+        }
+    };
+    // special to get_field function in datafusion/functions/src/core/mod.rs
+    ($FUNC:ident, $DOC:expr, $arg:ident, $arg2:ident) => {

Review Comment:
   Maybe move `functions` out of macro?



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

Reply via email to