You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/04/18 19:11:28 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #8563: Add common comparison scalar functions for filterConfig during ingestion (WIP)

Jackie-Jiang commented on code in PR #8563:
URL: https://github.com/apache/pinot/pull/8563#discussion_r852344126


##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArithmeticFunctions.java:
##########
@@ -153,4 +152,19 @@ public static double truncate(double a, int scale) {
   public static double truncate(double a) {
     return Math.signum(a) * Math.floor(Math.abs(a));
   }
+
+  @ScalarFunction(names = {"gte"})
+  public static boolean greaterThanOrEquals(double a, double b) {

Review Comment:
   Suggest adding a separate class for all the logical functions. See `FilterKind` enum for more supported logical functions



##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArrayFunctions.java:
##########
@@ -136,4 +136,13 @@ public static int[] arrayConcatInt(int[] values1, int[] values2) {
   public static String[] arrayConcatString(String[] values1, String[] values2) {
     return ArrayUtils.addAll(values1, values2);
   }
+
+  @ScalarFunction
+  public static double arraySum(Double[] values) {

Review Comment:
   Currently we don't support having different parameter type for the same scalar function, so we might need to use the same workaround similar to other functions by adding the type into the function name



-- 
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-unsubscribe@pinot.apache.org

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


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