zhangstar333 commented on code in PR #46405: URL: https://github.com/apache/doris/pull/46405#discussion_r1903555453
########## be/src/vec/functions/function_string.h: ########## @@ -3770,9 +3770,10 @@ class FunctionConvertTo : public IFunction { auto& res_offset = col_res->get_offsets(); auto& res_chars = col_res->get_chars(); res_offset.resize(input_rows_count); - // max pinyin size is 6, double of utf8 chinese word 3, add one char to set '~' - ColumnString::check_chars_length(str_chars.size() * 2 + input_rows_count, 0); - res_chars.resize(str_chars.size() * 2 + input_rows_count); + // max pinyin size is 6 + 1 (first '~') for utf8 chinese word 3 + size_t pinyin_size = (str_chars.size() + 2) / 3 * 7; Review Comment: this size +2 means? maybe could add some comment for the get the pinyin_size -- 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