ViniciusSouzaRoque commented on code in PR #12803:
URL: https://github.com/apache/arrow/pull/12803#discussion_r849326821


##########
cpp/src/gandiva/precompiled/string_ops.cc:
##########
@@ -2398,19 +2398,18 @@ 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,
                  bool* seenAnyValidInput) {
   if (!in_validity) {
-    *seenAnyValidInput = false;
     return;
   }
 
   // input is valid
-  if (*seenAnyValidInput || *out_idx > 0) {
+  if (*seenAnyValidInput) {
     // 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);
-  *seenAnyValidInput = true;
+  *seenAnyValidInput = *seenAnyValidInput || in_validity;

Review Comment:
   Done



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

Reply via email to