vvellanki commented on code in PR #12803:
URL: https://github.com/apache/arrow/pull/12803#discussion_r847537337
##########
cpp/src/gandiva/precompiled/string_ops.cc:
##########
@@ -2393,152 +2393,201 @@ const char* byte_substr_binary_int32_int32(gdv_int64
context, const char* text,
return ret;
}
+FORCE_INLINE
+void concat_word(char* out_buf, int* out_idx, const char* in_buf, int in_len,
+ bool in_validity, const char* separator, int separator_len) {
+ if (!in_validity) {
+ return;
+ }
+
+ // input is valid
+ if (*out_idx != 0) {
+ // copy the separator and update *out_idx
+ memcpy(out_buf + *out_idx, separator, separator_len);
+ *out_idx += separator_len;
+ }
+ // copy the input and update *out_idx
+ memcpy(out_buf + *out_idx, in_buf, in_len);
Review Comment:
Can you add a test where the first string is an empty string?
ws_concat of "", "hello" with a separator of '-'. This implementation return
"hello", should it "-hello" instead. Can you check?
--
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]