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 2020/08/19 02:57:39 UTC

[GitHub] [arrow] emkornfield commented on a change in pull request #7883: ARROW-9620: [C++] Added split function to Gandiva

emkornfield commented on a change in pull request #7883:
URL: https://github.com/apache/arrow/pull/7883#discussion_r472621421



##########
File path: cpp/src/gandiva/precompiled/string_ops.cc
##########
@@ -567,6 +567,54 @@ const char* castVARCHAR_utf8_int64(gdv_int64 context, const char* data,
   return data;
 }
 
+// Split a string into substrings, then return a particular one
+FORCE_INLINE
+const char* split_utf8_utf8_int32(gdv_int64 context, const char* str, gdv_int32 str_len,
+                                  const char* delimiter, gdv_int32 delimiter_len,
+                                  gdv_int32 ret_index, gdv_int32* out_len) {
+  if (ret_index < 1) {
+    gdv_fn_context_set_error_msg(context, "Substring index must be greater than 0");

Review comment:
       does this match a specific sql function?  otherwise I would expect 0 based indexing?




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