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 2022/04/13 01:59:59 UTC

[GitHub] [arrow] projjal commented on a diff in pull request #12860: ARROW-16169 [C++][Gandiva] Fix empty string case in convert_fromUTF8_binary()

projjal commented on code in PR #12860:
URL: https://github.com/apache/arrow/pull/12860#discussion_r849005047


##########
cpp/src/gandiva/precompiled/string_ops.cc:
##########
@@ -1407,6 +1407,10 @@ FORCE_INLINE
 const char* convert_fromUTF8_binary(gdv_int64 context, const char* bin_in, gdv_int32 len,
                                     gdv_int32* out_len) {
   *out_len = len;
+  // handle empty string case

Review Comment:
   Here malloc and memcpy are not required. You can just return the original string slice. Also malloc returning nullptr for zero length in certain cases is also a bug. Can you create a separate PR to fix that.



-- 
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: github-unsubscribe@arrow.apache.org

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