walterddr commented on code in PR #9554:
URL: https://github.com/apache/pinot/pull/9554#discussion_r1003934128


##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArrayFunctions.java:
##########
@@ -151,4 +152,29 @@ public static double[] arrayConcatDouble(double[] values1, 
double[] values2) {
   public static String[] arrayConcatString(String[] values1, String[] values2) 
{
     return ArrayUtils.addAll(values1, values2);
   }
+
+  @ScalarFunction
+  public static int arrayElementAtInt(int[] arr, int idx) {
+    return idx > 0 && idx <= arr.length ? arr[idx - 1] : (int) 
DataSchema.ColumnDataType.INT.getNullPlaceholder();

Review Comment:
   also there's no such function as `substr` in postgres. only `substring` and 
it is one-based. 



-- 
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: commits-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to