Skip to content

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

Open
nwt wants to merge 2 commits into
vector-empty-kind-namedfrom
vector-upcast-panic
Open

vam: fix panic in upcast() from union to union#7008
nwt wants to merge 2 commits into
vector-empty-kind-namedfrom
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.

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
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.

1 participant