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


##########
pinot-common/src/main/java/org/apache/pinot/common/function/FunctionRegistry.java:
##########
@@ -216,5 +216,11 @@ public static Object clpDecode(String logtypeFieldName, 
String dictVarsFieldName
         String defaultValue) {
       throw new UnsupportedOperationException("Placeholder scalar function, 
should not reach here");
     }
+
+    @ScalarFunction(names = {"arrayToMV", "array_to_mv", "arrayToMultiValue", 
"array_to_multi_value"},
+        isPlaceholder = true)
+    public static String arrayToMultiValue(Object multiValue) {

Review Comment:
   (minor)
   ```suggestion
       public static String arrayToMV(Object array) {
   ```



##########
pinot-query-planner/src/main/java/org/apache/pinot/query/parser/CalciteRexExpressionParser.java:
##########
@@ -199,6 +203,12 @@ private static Expression 
compileFunctionExpression(RexExpression.FunctionCall r
         return compileOrExpression(rexCall, pinotQuery);
       case OTHER_FUNCTION:
         functionName = rexCall.getFunctionName();
+        // Special handle for leaf stage multi-value columns, as the default 
behavior for filter and group by is not
+        // sql standard, so need to use `array_to_mv` to convert the array to 
v1 multi-value column for behavior
+        // consistency meanwhile not violating the sql standard.
+        if (ARRAY_TO_MV_ALIAS.contains(functionName)) {

Review Comment:
   Is function name always upper case?



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