nivia007 commented on a change in pull request #12440:
URL: https://github.com/apache/arrow/pull/12440#discussion_r818530942



##########
File path: cpp/src/gandiva/precompiled/string_ops.cc
##########
@@ -2207,6 +2213,12 @@ const char* right_utf8_int32(gdv_int64 context, const 
char* text, gdv_int32 text
     return "";
   }
 
+  //case where right('abcdef', -6) -> "" and right('abcdef', -7) -> ""
+  if(number < 0 && abs(number) >= text_len) {

Review comment:
       I tested it for left('abc¥', -4) and it is returning correct result, 
Would it better if I put this condition in the  for loop below
   if (number < 0 && char_count <= abs(number)) {
         *out_len = 0;
         return "";
       }




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