You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/26 13:13:32 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #4357: Clean the `expr_fn`

alamb commented on code in PR #4357:
URL: https://github.com/apache/arrow-datafusion/pull/4357#discussion_r1032786084


##########
datafusion/expr/src/expr_fn.rs:
##########
@@ -345,136 +332,181 @@ macro_rules! nary_scalar_expr {
 // generate methods for creating the supported unary/binary expressions
 
 // math functions
-unary_scalar_expr!(Sqrt, sqrt, "square root of a number");
-unary_scalar_expr!(Sin, sin, "sine");
-unary_scalar_expr!(Cos, cos, "cosine");
-unary_scalar_expr!(Tan, tan, "tangent");
-unary_scalar_expr!(Asin, asin, "inverse sine");
-unary_scalar_expr!(Acos, acos, "inverse cosine");
-unary_scalar_expr!(Atan, atan, "inverse tangent");
-unary_scalar_expr!(
+scalar_expr!(Sqrt, sqrt, num, "square root of a number");
+scalar_expr!(Sin, sin, num, "sine");
+scalar_expr!(Cos, cos, num, "cosine");
+scalar_expr!(Tan, tan, num, "tangent");
+scalar_expr!(Asin, asin, num, "inverse sine");
+scalar_expr!(Acos, acos, num, "inverse cosine");
+scalar_expr!(Atan, atan, num, "inverse tangent");
+scalar_expr!(
     Floor,
     floor,
+    num,
     "nearest integer less than or equal to argument"
 );
-unary_scalar_expr!(
+scalar_expr!(
     Ceil,
     ceil,
+    num,
     "nearest integer greater than or equal to argument"
 );
-unary_scalar_expr!(Round, round, "round to nearest integer");
-unary_scalar_expr!(Trunc, trunc, "truncate toward zero");
-unary_scalar_expr!(Abs, abs, "absolute value");
-unary_scalar_expr!(Signum, signum, "sign of the argument (-1, 0, +1) ");
-unary_scalar_expr!(Exp, exp, "exponential");
-unary_scalar_expr!(Log2, log2, "base 2 logarithm");
-unary_scalar_expr!(Log10, log10, "base 10 logarithm");
-unary_scalar_expr!(Ln, ln, "natural logarithm");
-scalar_expr!(NullIf, nullif, arg_1, arg_2);
-scalar_expr!(Power, power, base, exponent);
-scalar_expr!(Atan2, atan2, y, x);
+scalar_expr!(Round, round, num, "round to nearest integer");
+scalar_expr!(Trunc, trunc, num, "truncate toward zero");
+scalar_expr!(Abs, abs, num, "absolute value");
+scalar_expr!(Signum, signum, num, "sign of the argument (-1, 0, +1) ");
+scalar_expr!(Exp, exp, num, "exponential");
+scalar_expr!(Log2, log2, num, "base 2 logarithm");
+scalar_expr!(Log10, log10, num, "base 10 logarithm");
+scalar_expr!(Ln, ln, num, "natural logarithm");
+scalar_expr!(NullIf, nullif, arg_1 arg_2, "returns NULL if value1 equals value2; otherwise it returns value1. This can be used to perform the inverse operation of the COALESCE expression.");

Review Comment:
   👍 



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org