Skip to content

Preserve precision on 64-bit integers#9520

Merged
sspaink merged 1 commit intoinfluxdata:masterfrom
akrantz01:7555-64-bit-integers
Jul 20, 2021
Merged

Preserve precision on 64-bit integers#9520
sspaink merged 1 commit intoinfluxdata:masterfrom
akrantz01:7555-64-bit-integers

Conversation

@akrantz01
Copy link
Copy Markdown
Contributor

Required for all PRs:

  • Updated associated README.md.
  • Wrote appropriate unit tests.

resolves #7555

Fixed a bug in json_v2 where precision would be lost on int64s and uint64s by changing how they are parsed from the source JSON. This could not be fixed in the original json parser as there are no options for type conversions.

Previously, an int64 or uint64 would be converted from a float64, which has a maximum of 2^53 - 1 as that is the max significant digits it can store, causing precision to be lost on anything larger. Now the values are parsed directly from the source content of the JSON.

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Jul 19, 2021
@akrantz01 akrantz01 requested a review from sspaink July 19, 2021 19:22
Copy link
Copy Markdown
Contributor

@sspaink sspaink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Thank you for fixing this.

@sspaink sspaink merged commit 2eb0ee2 into influxdata:master Jul 20, 2021
reimda pushed a commit that referenced this pull request Jul 28, 2021
@Hipska Hipska added the area/json json and json_v2 parser/serialiser related label Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/json json and json_v2 parser/serialiser related fix pr to fix corresponding bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON input losing precision on 64bit integers

3 participants