gianm commented on a change in pull request #10605:
URL: https://github.com/apache/druid/pull/10605#discussion_r558098809



##########
File path: core/src/main/antlr4/org/apache/druid/math/expr/antlr/Expr.g4
##########
@@ -51,9 +51,12 @@ numericElement : (LONG | DOUBLE | NULL);
 literalElement : (STRING | LONG | DOUBLE | NULL);
 
 NULL : 'null';
+LONG : [0-9]+;
+EXP: [eE] [-]? LONG;
+// DOUBLE provides partial support for java double format
+// see: 
https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html#valueOf-java.lang.String-
+DOUBLE : 'NaN' | 'Infinity' | (LONG '.' LONG) | (LONG EXP) | (LONG '.' LONG 
EXP);

Review comment:
       This used to allow `10.` as a double, but now it doesn't. I think we 
should add that back. (with tests 🙂)

##########
File path: docs/misc/math-expr.md
##########
@@ -119,13 +119,14 @@ See javadoc of java.lang.Math for detailed explanation 
for each function.
 |acos|acos(x) would return the arc cosine of x|
 |asin|asin(x) would return the arc sine of x|
 |atan|atan(x) would return the arc tangent of x|
-|bitwiseAnd|bitwiseAnd(x,y) would return the result of x & y. Double values 
will be converted to their bit representation|
-|bitwiseComplement|bitwiseComplement(x) would return the result of ~x. Double 
values will be converted to their bit representation|
-|bitwiseConvertDouble|bitwiseConvertDouble(x) would convert the IEEE 754 
floating-point "double" bits stored in a long into a double value if the input 
is a long, or the copy bits of a double value into a long if the input is a 
double.|
-|bitwiseOr|bitwiseOr(x,y) would return the result of x [PIPE] y. Double values 
will be converted to their bit representation |
-|bitwiseShiftLeft|bitwiseShiftLeft(x,y) would return the result of x << y. 
Double values will be converted to their bit representation|
-|bitwiseShiftRight|bitwiseShiftRight(x,y) would return the result of x >> y. 
Double values will be converted to their bit representation|
-|bitwiseXor|bitwiseXor(x,y) would return the result of x ^ y. Double values 
will be converted to their bit representation|
+|bitwiseAnd|bitwiseAnd(x,y) would return the result of x & y. Double values 
will be implicitly cast to longs, use `bitwiseConvertDoubleToLongBits` to 
perform bitwise operations directly with doubles|
+|bitwiseComplement|bitwiseComplement(x) would return the result of ~x. Double 
values will be implicitly cast to longs, use `bitwiseConvertDoubleToLongBits` 
to perform bitwise operations directly with doubles|
+|bitwiseConvertDoubleToLongBits|bitwiseConvertDoubleToLongBits(x) would 
convert the IEEE 754 floating-point "double" bits stored in a long into a 
double value if the input is a long, or implicitly cast the value to a long if 
the input is a double|

Review comment:
       Are these docs for `bitwiseConvertDoubleToLongBits` correct? It doesn't 
sound like something that the function should do.




----------------------------------------------------------------
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:
us...@infra.apache.org



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

Reply via email to