Skip to content

Conversation

@nwt
Copy link
Member

@nwt nwt commented Oct 1, 2025

The sequential runtime returns a structured error when a bytes value containing invalid UTF-8 is cast to a string. Do the same in the vector runtime.

The change in runtime/vam/expr/cast.castToString implements the new behavior. The remaining changes just add a msgSuffix parameter to errCastFailed so castToString can produce the same error message as the sequential runtime.

There are some possible optimizations here but they can wait until castToString appears in CPU profiles.

The test coverage added to runtime/ztests/expr/cast/string.yaml
duplicates runtime/sam/expr/ztests/cast-bytes-string-err.yaml, so remove
the latter file.

The sequential runtime returns a structured error when a bytes value
containing invalid UTF-8 is cast to a string.  Do the same in the
vector runtime.

The change in runtime/vam/expr/cast.castToString implements the new
behavior.  The remaining changes just add a msgSuffix parameter to
errCastFailed so castToString can produce the same error message as the
sequential runtime.

There are some possible optimizations here but they can wait until
castToString appears in CPU profiles.
@nwt nwt requested a review from a team October 1, 2025 00:05
@nwt nwt merged commit 4586c71 into main Oct 2, 2025
3 checks passed
@nwt nwt deleted the vector-cast-bytes-to-string-error branch October 2, 2025 19:23
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.

4 participants