projjal commented on code in PR #12391:
URL: https://github.com/apache/arrow/pull/12391#discussion_r913250148
##########
cpp/src/gandiva/precompiled/string_ops.cc:
##########
@@ -3034,4 +3034,53 @@ int32_t instr_utf8(const char* string, int32_t
string_len, const char* substring
}
return 0;
}
+
+FORCE_INLINE
+int32_t find_in_set_utf8_utf8(int64_t context, const char* to_find, int32_t
to_find_len,
+ const char* string_list, int32_t
string_list_len) {
+ // Return 0 if entry len <= 0
+ if (to_find_len <= 0 || string_list_len <= 0) {
Review Comment:
empty strings shouldn't be valid.
Also these lengths are not user provided but rather is the string value
length passed by gandiva so it won't be negative
##########
cpp/src/gandiva/precompiled/string_ops.cc:
##########
@@ -3034,4 +3034,53 @@ int32_t instr_utf8(const char* string, int32_t
string_len, const char* substring
}
return 0;
}
+
+FORCE_INLINE
+int32_t find_in_set_utf8_utf8(int64_t context, const char* to_find, int32_t
to_find_len,
+ const char* string_list, int32_t
string_list_len) {
+ // Return 0 if entry len <= 0
+ if (to_find_len <= 0 || string_list_len <= 0) {
Review Comment:
empty strings shouldn't be invalid.
Also these lengths are not user provided but rather is the string value
length passed by gandiva so it won't be negative
--
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]