HappenLee commented on code in PR #42474:
URL: https://github.com/apache/doris/pull/42474#discussion_r1830534484


##########
be/src/vec/functions/function_string.cpp:
##########
@@ -144,8 +145,9 @@ struct StringUtf8LengthImpl {
         res.resize(size);
         for (int i = 0; i < size; ++i) {
             const char* raw_str = reinterpret_cast<const 
char*>(&data[offsets[i - 1]]);
-            int str_size = offsets[i] - offsets[i - 1];
-            res[i] = simd::VStringFunctions::get_char_len(raw_str, str_size);
+            ColumnString::Offset str_size = offsets[i] - offsets[i - 1];
+            // The return value of get_char_len is less than or equal to 
str_size.
+            res[i] = 
(ColumnString::Offset)simd::VStringFunctions::get_char_len(raw_str, str_size);

Review Comment:
   use template to refactor the code of `simd::VStringFunctions::get_char_len`



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to