Skip to content

vam: fix panic in upcast() from union to union#7008

Merged
nwt merged 6 commits into
mainfrom
vector-upcast-panic
Jun 1, 2026
Merged

vam: fix panic in upcast() from union to union#7008
nwt merged 6 commits into
mainfrom
vector-upcast-panic

Conversation

@nwt
Copy link
Copy Markdown
Member

@nwt nwt commented May 29, 2026

In runtime/vam/expr/function.Upcast.toUnion, when casting from a union, the loop that calls toUnionValue can produce multiple vectors with the same type (as when casting from <int8|int32|string> to <int64|string>), triggering a panic when those vectors are passed to vector.NewUnion. Fix by merging same-type vectors with vector.MergeSameTypesInDynamic.

Depends on #7007 and #7009.

nwt added 2 commits May 28, 2026 18:33
In runtime/vam/expr/function.Upcast.toUnion, when casting from a union,
the loop that calls toUnionValue can produce multiple vectors with the
same type (as when casting from <int8|int32|string> to <int64|string>),
triggering a panic when those vectors are passed to vector.NewUnion.
Fix by merging same-type vectors with vector.MergeSameTypesInDynamic.
@nwt nwt requested a review from a team May 29, 2026 17:43
Comment thread runtime/vam/expr/unblend.go Outdated
Base automatically changed from vector-empty-kind-named to main June 1, 2026 18:38
@nwt nwt changed the base branch from main to vector-stitch-nil June 1, 2026 18:43
Base automatically changed from vector-stitch-nil to main June 1, 2026 18:52
@nwt nwt merged commit a9675cd into main Jun 1, 2026
2 checks passed
@nwt nwt deleted the vector-upcast-panic branch June 1, 2026 19:59
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