You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/16 08:31:28 UTC

[GitHub] [arrow] projjal commented on a change in pull request #10059: ARROW-12410: [C++][Gandiva] Implement regexp_replace function on Gandiva

projjal commented on a change in pull request #10059:
URL: https://github.com/apache/arrow/pull/10059#discussion_r614659964



##########
File path: cpp/src/gandiva/precompiled/string_ops.cc
##########
@@ -131,6 +133,16 @@ bool is_substr_utf8_utf8(const char* data, int32_t data_len, const char* substr,
   return false;
 }
 
+FORCE_INLINE
+const char* regexp_replace(const char* regexp, const char* str, const char* replace_string) {
+    std::string s = str;
+    std::regex r (regexp);

Review comment:
       Please use RE2 instead of std::regex. Also use a holder to prevent compiling the pattern on each call. See like_holder.h




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org