The GitHub Actions job "Docs 404 check (beta)" on 
flink.git/FLINK-37925-followup has failed.
Run started by GitHub user raminqaf (triggered by raminqaf).

Head commit for run:
034835b429f489751ff073af3b4adb0112dc5832 / Ramin Gharib <[email protected]>
[FLINK-37925][table] Reject invalid UTF-8 when casting a VARIANT binary to a 
character string

A variant that stores a `BYTES` value renders as a character string by reading 
those bytes as UTF-8, the same as a regular `BINARY` to string cast. Bytes that 
are not well-formed UTF-8 were decoded anyway, and `new String(byte[], UTF_8)` 
substitutes `U+FFFD` for every ill-formed subpart, so the cast silently 
produced a character the value never held.

Validate the bytes first and fail with the index of the first invalid one. The 
error points at a `BYTES` cast to inspect the raw value, and at wrapping that 
in `MAKE_VALID_UTF8` to opt into the lenient decode. Both paths already work, 
since a `BYTES` cast copies the stored bytes without decoding them.

A variant that stores a `STRING` value is unaffected. Its bytes are only 
reachable already decoded, so there is nothing to validate at this layer. Such 
a value holding non-UTF-8 bytes means the variant binary itself is malformed, 
which belongs to a validation check on the binary rather than to a cast rule.

Report URL: https://github.com/apache/flink/actions/runs/30806555708

With regards,
GitHub Actions via GitBox

Reply via email to