You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/03/09 23:14:45 UTC

[GitHub] [druid] sthetland commented on a change in pull request #9488: Match GREATEST/LEAST function behavior to other DBs

sthetland commented on a change in pull request #9488: Match GREATEST/LEAST function behavior to other DBs
URL: https://github.com/apache/druid/pull/9488#discussion_r390011472
 
 

 ##########
 File path: docs/misc/math-expr.md
 ##########
 @@ -181,6 +181,22 @@ See javadoc of java.lang.Math for detailed explanation for each function.
 | all(lambda,arr) | returns 1 if all elements in the array matches the lambda expression, else 0 |
 
 
+### Reduction functions
+
+Reduction functions operate on zero or more expressions and return a single expression. If no expressions are passed
+as arguments, then the result is `NULL`. The expressions must all be convertible to a
+common data type, which will be the type of the result:
+*  If any argument is `NULL`, the result is `NULL`.
+*  If the arguments comprise a mix of numbers and strings, the arguments are interpreted as strings.
+*  If all arguments are integer numbers, the arguments are interpreted as longs.
+*  If all arguments are numbers and at least one argument is a double, the arguments are interpreted as doubles. 
+
+| function | description |
+| --- | --- |
+| greatest([expr1, ...]) | Returns the maximum expression across zero or more expressions. |
+| least([expr1, ...]) | Returns the minimum expression across zero or more expressions. |
 
 Review comment:
   ```suggestion
   | least([expr1, ...]) | Returns the smallest value among zero or more expressions. |
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org