Skip to content

vam: replace sam-based upcast() with native version#6820

Open
nwt wants to merge 4 commits intomainfrom
vam-upcast
Open

vam: replace sam-based upcast() with native version#6820
nwt wants to merge 4 commits intomainfrom
vam-upcast

Conversation

@nwt
Copy link
Copy Markdown
Member

@nwt nwt commented Apr 10, 2026

No description provided.

@nwt nwt marked this pull request as ready for review April 11, 2026 19:25
@nwt nwt requested a review from a team April 11, 2026 19:25
Comment on lines +26 to +39
b := vector.NewDynamicBuilder()
for i := range from.Len() {
typ, err := u.sctx.LookupByValue(vector.TypeValueValue(to, i))
if err != nil {
panic(err)
}
in := vector.Pick(from, []uint32{i})
out := u.upcast(in, typ)
if out == nil {
out = vector.NewWrappedError(u.sctx, "upcast: value not a subtype of "+sup.FormatType(typ), in)
}
b.Write(out)
}
return b.Build(u.sctx)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you see a faster way to do this.

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