HappenLee commented on code in PR #41681:
URL: https://github.com/apache/doris/pull/41681#discussion_r1802314314
##########
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:
`TrimInUtil` and `TrimUtil` better be a template param
--
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]