We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TRUNCATE
TRUNCATE functions returns incorrect result for some input data.
Test data: ddouble_mapping.json.txt ddouble.json.txt
curl -s -H 'Content-Type: application/json' -XPUT "http://localhost:9200/ddouble?pretty" -u admin:admin --insecure --data-binary @ddouble_mapping.json curl -s -H 'Content-Type: application/json' -XPOST "http://localhost:9200/ddouble/_bulk?pretty" -u admin:admin --insecure --data-binary @ddouble.json | grep -i error
SELECT `ddouble`.`key`, `ddouble`.`val`, TRUNCATE(`ddouble`.`val`, 1) AS `EXPR$2` FROM `ddouble`
2.x @ 21373b9
2.x
Reported on behalf of @kylepbit
sql/core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/MathematicalFunction.java
Lines 506 to 507 in f8c58f1
import java.math.BigDecimal import java.math.RoundingMode new BigDecimal(-1.2D).setScale(1, RoundingMode.DOWN).doubleValue() = -1.1
The text was updated successfully, but these errors were encountered:
https://peterdev.pl/all-you-need-to-know-about-javas-bigdecimal/
Sorry, something went wrong.
No branches or pull requests
What is the bug?
TRUNCATE
functions returns incorrect result for some input data.How can one reproduce the bug?
Test data:
ddouble_mapping.json.txt
ddouble.json.txt
What is your host/environment?
2.x
@ 21373b9Do you have any screenshots?
Do you have any additional context?
Reported on behalf of @kylepbit
sql/core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/MathematicalFunction.java
Lines 506 to 507 in f8c58f1
The text was updated successfully, but these errors were encountered: