FrankChen021 commented on a change in pull request #11904:
URL: https://github.com/apache/druid/pull/11904#discussion_r747151612



##########
File path: docs/querying/sql.md
##########
@@ -414,9 +414,11 @@ to FLOAT. At runtime, Druid will widen 32-bit floats to 
64-bit for most expressi
 |`BITWISE_SHIFT_LEFT(expr1, expr2)`|Returns the result of `expr1 << expr2`. 
Double values will be implicitly cast to longs, use 
`BITWISE_CONVERT_DOUBLE_TO_LONG_BITS` to perform bitwise operations directly 
with doubles|
 |`BITWISE_SHIFT_RIGHT(expr1, expr2)`|Returns the result of `expr1 >> expr2`. 
Double values will be implicitly cast to longs, use 
`BITWISE_CONVERT_DOUBLE_TO_LONG_BITS` to perform bitwise operations directly 
with doubles|
 |`BITWISE_XOR(expr1, expr2)`|Returns the result of `expr1 ^ expr2`. Double 
values will be implicitly cast to longs, use 
`BITWISE_CONVERT_DOUBLE_TO_LONG_BITS` to perform bitwise operations directly 
with doubles|
+|`DIV(x,y)`|Returns the result of integer division of x by y |
 |`HUMAN_READABLE_BINARY_BYTE_FORMAT(value[, precision])`| Format a number in 
human-readable [IEC](https://en.wikipedia.org/wiki/Binary_prefix) format. For 
example, HUMAN_READABLE_BINARY_BYTE_FORMAT(1048576) returns `1.00 MiB`. 
`precision` must be in the range of [0,3] (default: 2). |
 |`HUMAN_READABLE_DECIMAL_BYTE_FORMAT(value[, precision])`| Format a number in 
human-readable [SI](https://en.wikipedia.org/wiki/Binary_prefix) format. 
HUMAN_READABLE_DECIMAL_BYTE_FORMAT(1048576) returns `1.04 MB`. `precision` must 
be in the range of [0,3] (default: 2). `precision` must be in the range of 
[0,3] (default: 2). |
 |`HUMAN_READABLE_DECIMAL_FORMAT(value[, precision])`| Format a number in 
human-readable SI format. For example, HUMAN_READABLE_DECIMAL_FORMAT(1048576) 
returns `1.04 M`. `precision` must be in the range of [0,3] (default: 2). |
+|`SAFE_DIVIDE(x,y)`|Returns the division of x by y guarded on division by 0 |

Review comment:
       It's better to put it along with the 'DIV' function above.

##########
File path: docs/misc/math-expr.md
##########
@@ -154,6 +154,7 @@ See javadoc of java.lang.Math for detailed explanation for 
each function.
 |remainder|remainder(x, y) returns the remainder operation on two arguments as 
prescribed by the IEEE 754 standard|
 |rint|rint(x) returns value that is closest in value to x and is equal to a 
mathematical integer|
 |round|round(x, y) returns the value of the x rounded to the y decimal places. 
While x can be an integer or floating-point number, y must be an integer. The 
type of the return value is specified by that of x. y defaults to 0 if omitted. 
When y is negative, x is rounded on the left side of the y decimal points. If x 
is `NaN`, x returns 0. If x is infinity, x will be converted to the nearest 
finite double. |
+|safe_divide|safe_divide(x,y) returns the division of x by y if y is not equal 
to 0, returns 0 otherwise|

Review comment:
       What if either x or y is NULL?




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