yordan-pavlov commented on a change in pull request #1082:
URL: https://github.com/apache/arrow-rs/pull/1082#discussion_r785494166
##########
File path: parquet/src/arrow/array_reader/offset_buffer.rs
##########
@@ -68,6 +77,16 @@ impl<I: OffsetSizeTrait + ScalarValue> OffsetBuffer<I> {
Ok(())
}
+ /// Returns the values buffer as a string slice, returning an error
+ /// if it is invalid UTF-8
+ ///
+ /// `start_offset` is the offset in bytes from the start
+ pub fn values_as_str(&self, start_offset: usize) -> Result<&str> {
+
std::str::from_utf8(&self.values.as_slice()[start_offset..]).map_err(|e| {
Review comment:
if the &str result is not actually used, does this method need to return
it? e.g. why not change to `-> Result<()>` and possibly even change the method
name to something like `check_valid_utf8`.
--
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]