-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
ION deserialization type change from Double to Float in 2.17.0 #490
Comments
Quick question: is this
intentional? Shouldn't first one compare to And yes, type of numbers should be retained: numbers written as As to the root cause, it looks like a regression: probably due to changes intended (ironically enough) retain type across those backends capable of distinguishing difference (textual formats like JSON cannot, binary formats like Ion typically do). I'll see if I find time to create a unit test and see what is happening EDIT: no, I get it now; test is as intended due to "Double-ness" of Ion API. |
Ohhhh. Now I remember: one oddity of Similarly, At any rate, precision should never be lost so getting |
Ok. Yeah, I was right to be suspicious -- looks like this from 2.17 branch
so I think that's what should be changed. But I'll need more time to investigate this... |
Ugh. And documentation is both precise and slightly confusing: https://amazon-ion.github.io/ion-docs/docs/float.html claims that both 32- and 64-bit FP values are supported. yet then goes to say... " In the data model, all floating point values are treated as though they are binary64 " Hmmmh. Ok. |
Fixed in 2.17 branch for upcoming 2.17.1 release |
Thank you so much for your help! |
FWTW, Jackson 2.17.1 was just released, with ~20 fixes this included: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.17.1 |
Hello, on my current projet we have tried to upgrade our dependencies from Jackson 2.16.2 to 2.17.0. But we're noticing a difference in the way the data is deserialized with ION.
Previsouly, the deserialization of either a float (e.g.,
42F
) or a double (e.g.,42D
) was giving a double for both. This behavior changed and we now get float for both.Here is a simple test for reproducing:
Deserialization results:
Jackson 2.16.2
![jackson-2 16 2-ion](https://private-user-images.githubusercontent.com/1786576/327711449-480936a8-cee1-4c0f-a269-1bb69d11de39.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxNTc0MTksIm5iZiI6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16LURhdGU9MjAyNDA5MTJUMTYwNTE5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTBhN2QzY2ViYWJhZmViNmJkOTUxZWZiZTczMzUwY2E1M2JiOWFjOGFlZmFhOGY4ZDFmMGE4YjYzY2IwYWZlZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.g22A8qb5g7_ZX7-WEJWjaOzEM-U18jc06v9F1PuDKF8)
Do you know where this change might come from?
Thank you for your help.
The text was updated successfully, but these errors were encountered: