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 2020/10/05 22:41:06 UTC

[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6105: scalar functions for array

Jackie-Jiang commented on a change in pull request #6105:
URL: https://github.com/apache/incubator-pinot/pull/6105#discussion_r499909017



##########
File path: pinot-common/src/main/java/org/apache/pinot/common/function/FunctionUtils.java
##########
@@ -56,6 +61,12 @@ private FunctionUtils() {
     put(Double.class, PinotDataType.DOUBLE);
     put(String.class, PinotDataType.STRING);
     put(byte[].class, PinotDataType.BYTES);
+    put(int[].class, PinotDataType.INTEGER_ARRAY);
+    put(int.class, PinotDataType.INTEGER);

Review comment:
       Why do you need `int` here? The argument should always be `Object`

##########
File path: pinot-common/src/main/java/org/apache/pinot/common/function/FunctionUtils.java
##########
@@ -42,6 +42,11 @@ private FunctionUtils() {
     put(Double.class, PinotDataType.DOUBLE);
     put(String.class, PinotDataType.STRING);
     put(byte[].class, PinotDataType.BYTES);
+    put(int[].class, PinotDataType.INTEGER_ARRAY);

Review comment:
       Can we keep the same order as the SV ones (int, long, float, double, string), same for other places

##########
File path: pinot-common/src/main/java/org/apache/pinot/common/function/FunctionUtils.java
##########
@@ -69,6 +80,12 @@ private FunctionUtils() {
     put(Double.class, DataType.DOUBLE);
     put(String.class, DataType.STRING);
     put(byte[].class, DataType.BYTES);
+    put(int[].class, DataType.INT);
+    put(String[].class, DataType.STRING);
+    put(long[].class, DataType.LONG);
+    put(float[].class, DataType.FLOAT);
+    put(double[].class, DataType.DOUBLE);
+    put(boolean.class, DataType.BOOLEAN);

Review comment:
       Don't add `boolean` here as `DataType.BOOLEAN` is not a valid internal `DataType` (we use `STRING` to represent boolean). All the unrecognized types will be handled as `STRING`




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

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