findepi commented on code in PR #6668:
URL: https://github.com/apache/arrow-rs/pull/6668#discussion_r1826843346
##########
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:
the role of simdutf8::basic::from_utf8 and re-run with simdutf8::compat --
does this deserve a code comment?
(at least the `.unwrap_err()` safety deserves one)
##########
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:
same in offset_buffer.rs
--
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]