You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Yury-Fridlyand Currently if you put a double in you get a double out, and if you put a long in you get a long out.
If you put a double into round(x) should it return a long always? If you put a double into round(x, y) you can specify how many decimal points to return so sometimes it would have decimals and sometimes it wouldn't, should this always return a double?
I expected round(double x) to return long and java's Math.round does. On another hand, MySQL returns double in that case, and we're aligning with MySQL.
Probably I got confused between these two behaviours and it is not a bug actually.
What is the bug?
sql/core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/MathematicalFunction.java
Lines 411 to 419 in 43ceda1
sql/core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/MathematicalFunction.java
Lines 397 to 398 in 43ceda1
How can one reproduce the bug?
What is the expected behavior?
ROUND
function should return an integer value (INTEGER
orLONG
).It may happen that returned FP value is not an integer number (has digits after the point).
The text was updated successfully, but these errors were encountered: