naman1996 commented on a change in pull request #8231: URL: https://github.com/apache/arrow/pull/8231#discussion_r495902001
########## File path: cpp/src/gandiva/precompiled/string_ops.cc ########## @@ -835,6 +845,59 @@ const char* replace_utf8_utf8_utf8(gdv_int64 context, const char* text, out_len); } +FORCE_INLINE +const char* split_part(gdv_int64 context, const char* text, gdv_int32 text_len, + const char* delimiter, gdv_int32 delim_len, gdv_int32 index, + gdv_int32* out_len) { + char* ret; + if (index < 1) { + gdv_fn_context_set_error_msg(context, "Index should be >= 1"); + return ""; + } + + if (delim_len == 0 || text_len == 0) { + // output will just be text if no delimiter is provided + return text; + } + + // converting both c style arrays to string for easy processing + std::string input = std::string(text); Review comment: currently this will work but after refactor to remove string won't. Will need to handle that separately after removing std::string. ---------------------------------------------------------------- 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: us...@infra.apache.org