neilconway commented on code in PR #21366:
URL: https://github.com/apache/datafusion/pull/21366#discussion_r3046053034
##########
datafusion/functions/src/unicode/substr.rs:
##########
@@ -296,16 +296,15 @@ fn string_view_substr(
let count = count_array_opt.map(|a| a.value(i));
let raw_view = string_view_array.views()[i];
- let (start, end) =
- get_true_start_end(string, start, count, enable_ascii_fast_path)?;
- let substr = &string[start..end];
+ let (byte_start, byte_end) = get_true_start_end(string, start, count,
is_ascii)?;
+ let substr = &string[byte_start..byte_end];
make_and_append_view(
&mut views_buf,
&mut null_builder,
&raw_view,
substr,
- start as u32,
+ byte_start as u32,
Review Comment:
This is pre-existing code, but it looks safe to me: `byte_start` is bounded
by the length of a string in a `StringViewArray`, which must fit in a u32.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]