-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
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
Rounding error on keyword field in Discover #38398
Comments
Pinging @elastic/kibana-app |
This will be a very hard one to fix, and comes down a lot to the problems of JavaScript only having 64bit integer numbers (see also #31424 for a more detailed explanation of that problem). The value you specified is above the range that JavaScript still can store numeric values precisely, so we loose something as soon as it becomes a JavaScript number. Why is it working in Console? In console the response will never be parsed to JSON, but instead we use the But for pretty much all other parts of Kibana we actually use the response as JSON and in that very moment where we're getting that response, meaning in that very moment we lost the precision in the number and we're not having any chance of restoring it again. In contrast to the cc @peterschretlen just so you aware, since that 64bit issue came up already in a couple of different forms. |
Seems like
|
Actually there is a JSON parser library that handles BigInt by converting them to string: |
|
I will close this issue since there's nothing we can do in the short term, since JavaScript doesn't support 64bit numbers by default and will instead reference to the overall discussion for 64bit integer values: #1274 |
Kibana version: 6.5-7.1 (at least)
Elasticsearch version: 6.5-7.1 (at least)
Server OS version: ESS
Browser version: Version 74.0.3729.157 (Official Build) (64-bit)
Browser OS version: OSX 10.13.6
Original install method (e.g. download page, yum, from source, etc.): ESS
Describe the bug:
A document with a keyword field that has a value of
9800125870205439
in Elasticsearch is rendered as9800125870205440
in Kibana's Discover pane.Steps to reproduce:
The
/_search
returns:I then create an index pattern based on
foo
and accept all the defaults, then go toDiscover
, select that index pattern, and I see:Checking Chrome Developer Tools' Network panel I see:
which then results in:
Note that the value above is the incorrect
9800125870205440
, not9800125870205439
.Everything seems fine in Elasticsearch, or even when querying in DevTools in Kibana. I'm only seeing this happen in Discover.
NOTE: This appears to be some sort of type conversion/rounding issue. Note that if I index the value with quotes, like this:
then the value is rendered correctly in Kibana's Discover panel.
Expected behavior:
The document would render with the correct, original value of
9800125870205439
.Errors in browser console (if relevant): None
The text was updated successfully, but these errors were encountered: