Skip to content

fix(arrow/scalar): release partial children after failed struct conversion - #1114

Merged
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/scalar-toscalar-cleanup
Aug 11, 2026
Merged

fix(arrow/scalar): release partial children after failed struct conversion#1114
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/scalar-toscalar-cleanup

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

ToScalar creates child scalars incrementally. If a later Struct field fails, earlier array-backed children can remain retained after the conversion returns an error.

What changes are included in this PR?

Release partial children on failure while keeping the existing ownership transfer for a completed struct scalar. Add checked-allocator coverage for the failed conversion.

Are these changes tested?

  • go test ./arrow/scalar

Are there any user-facing changes?

No API changes. This corrects the reported behavior while preserving the existing ownership and compatibility contracts.

@fallintoplace fallintoplace changed the title fix(arrow/scalar): release partial struct conversions fix(arrow/scalar): release children after failed struct conversion Aug 5, 2026
@fallintoplace fallintoplace changed the title fix(arrow/scalar): release children after failed struct conversion fix(arrow/scalar): release partial children after failed struct conversion Aug 6, 2026
@fallintoplace
fallintoplace force-pushed the fix/scalar-toscalar-cleanup branch from e8fa649 to 3fc83c1 Compare August 6, 2026 17:36
@zeroshade

Copy link
Copy Markdown
Member

@fallintoplace Heads-up: #1106 has just been merged into main. It touches the same arrow/scalar/ code as this PR, so GitHub now reports this branch as conflicting.

Nothing is wrong with this PR — it is still approved. It just needs a rebase onto the latest main to resolve the overlap, and then it can go in.

Apologies for the extra round-trip: the conflict is a side effect of the sibling fix landing first, not anything you did.


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.

@fallintoplace
fallintoplace force-pushed the fix/scalar-toscalar-cleanup branch from 4db44ef to b159ff5 Compare August 10, 2026 17:53
@zeroshade
zeroshade merged commit db4317e into apache:main Aug 11, 2026
23 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