Skip to content
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

Fix two issues with JSON downconversion. #328

Merged
merged 2 commits into from
Oct 16, 2023

Conversation

nirosys
Copy link
Contributor

@nirosys nirosys commented Aug 18, 2023

Issue #, if available: N/A

Description of changes:
This PR fixes two issues with JSON downconversion that were found while conducting performance comparison with JSON parsers.

The first issue presented when converting ion data with type annotations to JSON. While writing data with annotations, the writer would track the annotations for write but would never write them (as intended), which resulted in the annotations never being cleared. If enough annotations were contained in the original data to exceed the max annotations configured, further writes would result in an error.

This PR addresses this issue by not tracking annotations if we are in a JSON downconversion mode. Since we discard type annotations in this mode, there is no reason to track them in the writer.

The second issue presented when serializing a double in a container, while in JSON downconversion mode. The function implemented to serialize doubles into a json format did not account for the separator required in containers which would result in an invalid serialization like: [1.01.0], rather than [1.0,1.0].

Unit tests have been added for both fixes.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@nirosys nirosys marked this pull request as ready for review August 21, 2023 20:09
@nirosys nirosys merged commit 41f14c7 into amazon-ion:master Oct 16, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants