Skip to content

Use ParseFloat with json.Number in Int64/Uint64 Builders' UnmarshalOne - #475

Draft
loicalleyne wants to merge 2 commits into
apache:mainfrom
loicalleyne:JSONReader-integer-exponent
Draft

Use ParseFloat with json.Number in Int64/Uint64 Builders' UnmarshalOne#475
loicalleyne wants to merge 2 commits into
apache:mainfrom
loicalleyne:JSONReader-integer-exponent

Conversation

@loicalleyne

Copy link
Copy Markdown
Contributor

Rationale for this change

Addresses #474

What changes are included in this PR?

Replaced strconv.ParseInt/strconv.ParseUint with strconv.ParseFloat in Int64/Uint64Builder.UnmarshalOne

Are these changes tested?

Existing tests pass.

Are there any user-facing changes?

No

@loicalleyne
loicalleyne requested a review from zeroshade as a code owner August 15, 2025 15:55
@zeroshade

Copy link
Copy Markdown
Member

Do we need to do this for ALL the integer types? not just int64/uint64?

Can you add a relevant test case for this please?

@Dhruvit96

Copy link
Copy Markdown
Contributor

FWIW, while exploring issues and PRs, I noticed that using ParseFloat isn’t the right solution. The problem is that it loses precision for integers larger than 2^53 (for example, "9007199254740993" gets converted to 9.007199254740993e+15).
ref: https://go.dev/play/p/DHzSTvI07iE

@zeroshade
zeroshade marked this pull request as draft August 10, 2026 16:36
@zeroshade

Copy link
Copy Markdown
Member

@loicalleyne Converting to draft — this PR doesn't yet meet our Pull Request quality criteria.

  • Merge conflicts — this branch conflicts with main. See docs.

Note: Your branch is 483 commits behind main. Please rebase and push again to get up-to-date CI results.

See the linked criteria for how to fix each item, then mark the PR "Ready for review". This is not a rejection — just an invitation to bring the PR up to standard. No rush.


Note: This comment was drafted by an AI-assisted triage tool run by a maintainer, and may contain mistakes. Once you have addressed the points above, an Apache Arrow Go maintainer — a real person — will take the next look at your PR. If anything here looks wrong, say so on the PR and a maintainer will follow up. See CONTRIBUTING.md for the project's contribution conventions.

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.

3 participants