Skip to content

GH-41156: [Go] Backporting fix to v12 - #41157

Closed
zeroshade wants to merge 1 commit into
apache:maint-12.0.xfrom
zeroshade:backport-marshalling
Closed

zeroshade wants to merge 1 commit into
apache:maint-12.0.xfrom
zeroshade:backport-marshalling

Conversation

@zeroshade

@zeroshade zeroshade commented Apr 11, 2024 •

Copy link
Copy Markdown
Member

GH-35948: [Go] Only cast int8 and unit8 to float64 when JSON marshaling arrays (#35950)

Rationale for this change

See issue.

Based on

{{else if (eq .Size "1")}}
it seems we should only do the casting for unit8 and int8 types.

What changes are included in this PR?

This PR fixes the numeric template so it only casts int8 and unit8 to float64 when JSON marshaling arrays to avoid losing data for other types.

Are these changes tested?

Yes

Are there any user-facing changes?

The user facing change is that if a user was JSON marshaling arrays that has uint64 or int64 values they can now get different (more accurate) values than before

Authored-by: erezrokah [email protected]
Signed-off-by: Matt Topol [email protected]
(cherry picked from commit 745fa94)

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

…SON marshaling arrays (apache#35950)

### Rationale for this change

See [issue](apache#35948).

Based on https://github.com/apache/arrow/blob/9fb8697dcb442f63317c7d6046393fb74842e0ae/go/arrow/array/numeric.gen.go.tmpl#L120 it seems we should only do the casting for `unit8` and `int8` types.

### What changes are included in this PR?

This PR fixes the numeric template so it only casts `int8` and `unit8` to `float64` when JSON marshaling arrays to avoid losing data for other types.

### Are these changes tested?

Yes

### Are there any user-facing changes?

The user facing change is that if a user was JSON marshaling arrays that has `uint64` or `int64` values they can now get different (more accurate) values than before

* Closes: apache#35948

Authored-by: erezrokah <[email protected]>
Signed-off-by: Matt Topol <[email protected]>
(cherry picked from commit 745fa94)
@zeroshade
zeroshade requested review from assignUser and raulcd April 11, 2024 19:53
@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #41156 has been automatically assigned in GitHub to PR creator.

@assignUser

assignUser commented Apr 13, 2024 •

Copy link
Copy Markdown
Member

@github-actions crossbow submit test--go-
just testing

@github-actions

This comment was marked as outdated.

@github-actions

Copy link
Copy Markdown

Revision: 8ace49b

Submitted crossbow builds: ursacomputing/crossbow @ actions-10c101a878

Task Status
test-debian-11-go-1.17 Azure
test-debian-11-go-1.20 Azure

@assignUser assignUser closed this Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants