liujiwen-up commented on code in PR #41681: URL: https://github.com/apache/doris/pull/41681#discussion_r1802484040
########## be/src/vec/functions/function_string.cpp: ########## @@ -640,6 +788,38 @@ class FunctionTrim : public IFunction { } }; +template <typename impl> Review Comment: done ########## be/src/vec/functions/function_string.cpp: ########## @@ -583,14 +722,23 @@ struct Trim2Impl { const auto* remove_str_raw = col_right->get_chars().data(); const ColumnString::Offset remove_str_size = col_right->get_offsets()[0]; const StringRef remove_str(remove_str_raw, remove_str_size); + if (remove_str.size == 1) { RETURN_IF_ERROR((TrimUtil<is_ltrim, is_rtrim, true>::vector( col->get_chars(), col->get_offsets(), remove_str, col_res->get_chars(), col_res->get_offsets()))); } else { - RETURN_IF_ERROR((TrimUtil<is_ltrim, is_rtrim, false>::vector( - col->get_chars(), col->get_offsets(), remove_str, col_res->get_chars(), - col_res->get_offsets()))); + if constexpr (std::is_same<Name, NameTrimIn>::value || Review Comment: done -- 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