MohamedAbdeen21 commented on code in PR #10700:
URL: https://github.com/apache/datafusion/pull/10700#discussion_r1621195045
##########
datafusion/functions/src/macros.rs:
##########
@@ -36,25 +36,31 @@
/// ]
/// }
/// ```
+///
+/// Exported functions accept:
+/// - `Vec<Expr>` argument (single argument followed by a comma)
+/// - Variable number of `Expr` arguments (zero or more arguments, must be
without commas)
macro_rules! export_functions {
- ($(($FUNC:ident, $($arg:ident)*, $DOC:expr)),*) => {
- pub mod expr_fn {
- $(
- #[doc = $DOC]
- /// Return $name(arg)
- pub fn $FUNC($($arg: datafusion_expr::Expr),*) ->
datafusion_expr::Expr {
- super::$FUNC().call(vec![$($arg),*],)
- }
- )*
+ ($(($FUNC:ident, $DOC:expr, $($arg:tt)*)),*) => {
+ $(
+ // switch to single-function cases below
+ export_functions!(single $FUNC, $DOC, $($arg)*);
Review Comment:
A little hack to avoid making a separate 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]