csun5285 commented on code in PR #47964: URL: https://github.com/apache/doris/pull/47964#discussion_r1972812781
########## be/src/vec/columns/column_string.cpp: ########## @@ -569,28 +588,25 @@ ColumnPtr ColumnStr<T>::replicate(const IColumn::Offsets& replicate_offsets) con res_chars.reserve(chars.size() / col_size * replicate_offsets.back()); res_offsets.reserve(replicate_offsets.back()); - T prev_replicate_offset = 0; - T prev_string_offset = 0; T current_new_offset = 0; - for (size_t i = 0; i < col_size; ++i) { - T size_to_replicate = replicate_offsets[i] - prev_replicate_offset; - T string_size = offsets[i] - prev_string_offset; + size_t size_to_replicate = replicate_offsets[i] - replicate_offsets[i - 1]; + T string_size = offsets[i] - offsets[i - 1]; + + check_chars_length(res_chars.size() + size_to_replicate * string_size, + res_offsets.size() + size_to_replicate, col_size); + res_chars.resize(res_chars.size() + size_to_replicate * string_size); Review Comment: add check `check_chars_length` -- 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