gortiz commented on code in PR #16431:
URL: https://github.com/apache/pinot/pull/16431#discussion_r2239920857


##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArrayFunctions.java:
##########
@@ -136,11 +136,17 @@ public static boolean arrayContainsString(String[] 
values, String valueToFind) {
 
   @ScalarFunction
   public static int[] arraySliceInt(int[] values, int start, int end) {
+    if (start < 0 || end > values.length || start >= end) {

Review Comment:
   You are right. we can change that case. What I wanted to do is to not fail 
when indexes are invalid but instead return an empty array. Anyway this is not 
required for the UDF framework, just something I though it was easy to fix. But 
after adding several other UDFs I decided to not modify the code I found 
incorrect because there are so many cases that they deserve their own PR and 
discuss about changes on semantics.
   
   Therefore I think I'm going to rollback this change.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to