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


##########
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:
   Thought about that, the only problem is how can we split the definition of 
`pub fn functions()`  between two different macros, without pulling it into 
it's own 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