etseidl commented on code in PR #6668:
URL: https://github.com/apache/arrow-rs/pull/6668#discussion_r1907995431
##########
parquet/src/arrow/array_reader/byte_view_array.rs:
##########
@@ -679,9 +679,12 @@ impl ByteViewArrayDecoderDelta {
/// Check that `val` is a valid UTF-8 sequence
pub fn check_valid_utf8(val: &[u8]) -> Result<()> {
- match std::str::from_utf8(val) {
+ match simdutf8::basic::from_utf8(val) {
Ok(_) => Ok(()),
- Err(e) => Err(general_err!("encountered non UTF-8 data: {}", e)),
+ Err(_) => {
+ let e = simdutf8::compat::from_utf8(val).unwrap_err();
Review Comment:
Could we have our own `from_utf8` that wraps the `simdutf8` implementation?
Then the weird basic/compat path would only need to be documented once (and
make it easier to replace other `from_utf8` invocations that @alamb identified).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]