This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch dev-1.0.1 in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
commit 199393afc9a2bbef40e711b33fae05c8f93e065c Author: Pxl <[email protected]> AuthorDate: Sun Mar 20 23:11:24 2022 +0800 [fix](vec) fix regexp_replace get wrong result on clang (#8505) --- be/src/vec/functions/function_regexp.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/be/src/vec/functions/function_regexp.cpp b/be/src/vec/functions/function_regexp.cpp index 4613fa9..570c7f3 100644 --- a/be/src/vec/functions/function_regexp.cpp +++ b/be/src/vec/functions/function_regexp.cpp @@ -140,7 +140,8 @@ struct RegexpReplaceImpl { } re2::StringPiece replace_str = - re2::StringPiece(replace_col->get_data_at(i).to_string()); + re2::StringPiece(replace_col->get_data_at(i).to_string_view()); + std::string result_str(str_col->get_data_at(i).to_string()); re2::RE2::GlobalReplace(&result_str, *re, replace_str); StringOP::push_value_string(result_str, i, result_data, result_offset); @@ -185,7 +186,7 @@ struct RegexpExtractImpl { scoped_re.reset(re); } const auto& str = str_col->get_data_at(i); - re2::StringPiece str_sp = re2::StringPiece(str.data,str.size); + re2::StringPiece str_sp = re2::StringPiece(str.data, str.size); int max_matches = 1 + re->NumberOfCapturingGroups(); if (index_data >= max_matches) { @@ -194,8 +195,8 @@ struct RegexpExtractImpl { } std::vector<re2::StringPiece> matches(max_matches); - bool success = re->Match(str_sp, 0, str.size, re2::RE2::UNANCHORED, &matches[0], - max_matches); + bool success = + re->Match(str_sp, 0, str.size, re2::RE2::UNANCHORED, &matches[0], max_matches); if (!success) { StringOP::push_empty_string(i, result_data, result_offset); continue; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
