-
Notifications
You must be signed in to change notification settings - Fork 353
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
U64 as displayed in the UI are wrong. #2013
Comments
Twitter answered both types and settled on returning strings for integers. https://developer.twitter.com/en/docs/twitter-ids My 2 cents:
If you need to expose an API and not just write an UI, I feel this is best. |
We could use a custom parser in the browser https://github.com/josdejong/lossless-json |
Yes, every browser UI would need to have some solution for that or may run into the same issue. |
i64 an i32 yes. They keep the data as is meaning the client may have surprises. The same issue is opened with Kibana elastic/kibana#40183 |
@saroh thank you! |
As spotted in #2011.
U64 field are very nice for users indexing ids.
They can be a nicer solution than strings, for instance if we do grouping and the number of distinct values does not justify dicitonary encoding.
Javascript will deserialize their JSON value as a javascript Number, which has a limited precision.
The number as displayed in the UI will hence be erroneous.
This limitation is not really a JSON issue (AFAIK JSON does not
restrict the range of integer values), but is shared by many other programming language.
I am not entirely sure what we should do here tbh. :)
We also probably support string as an input for u64.
On serialize, a common solution to this problem is to add a string version of int fields.
But then we could have some collision problems.
We could add a serialization option to serializes all ints as a string.
The text was updated successfully, but these errors were encountered: